Strings Test a

Last updated over 1 year ago
20 questions
1

What is output by the following code?
s = "dog food";
print( s )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s )

1

What is output by the following code?
s = "dog";
print( len(s) )

1

What is output by the following code?
s = "dog food";
print( len(s) )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( len(s) )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[0] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[1] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[4] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[5] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:2] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[2:5] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:0] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:1] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[:-2] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[8:-2] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s[8:-4] )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s.find("s") )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s.rfind("s") )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s.find("x") )

1

What is output by the following code?
s = "www.apluscompsci.com";
print( s.rfind("co") )