Strings Test a
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
20 Questions
1 point
1
Question 1
1.
What is output by the following code?s = "dog food";print( s )
What is output by the following code?
s = "dog food";
print( s )
1 point
1
Question 2
2.
What is output by the following code?s = "www.apluscompsci.com";print( s )
What is output by the following code?
s = "www.apluscompsci.com";
print( s )
1 point
1
Question 3
3.
What is output by the following code?s = "dog";print( len(s) )
What is output by the following code?
s = "dog";
print( len(s) )
1 point
1
Question 4
4.
What is output by the following code?s = "dog food";print( len(s) )
What is output by the following code?
s = "dog food";
print( len(s) )
1 point
1
Question 5
5.
What is output by the following code?s = "www.apluscompsci.com";print( len(s) )
What is output by the following code?
s = "www.apluscompsci.com";
print( len(s) )
1 point
1
Question 6
6.
What is output by the following code?s = "www.apluscompsci.com";print( s[0] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0] )
1 point
1
Question 7
7.
What is output by the following code?s = "www.apluscompsci.com";print( s[1] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[1] )
1 point
1
Question 8
8.
What is output by the following code?s = "www.apluscompsci.com";print( s[4] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[4] )
1 point
1
Question 9
9.
What is output by the following code?s = "www.apluscompsci.com";print( s[5] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[5] )
1 point
1
Question 10
10.
What is output by the following code?s = "www.apluscompsci.com";print( s[0:2] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:2] )
1 point
1
Question 11
11.
What is output by the following code?s = "www.apluscompsci.com";print( s[2:5] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[2:5] )
1 point
1
Question 12
12.
What is output by the following code?s = "www.apluscompsci.com";print( s[0:0] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:0] )
1 point
1
Question 13
13.
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[0:1] )
1 point
1
Question 14
14.
What is output by the following code?s = "www.apluscompsci.com";print( s[:-2] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[:-2] )
1 point
1
Question 15
15.
What is output by the following code?s = "www.apluscompsci.com";print( s[8:-2] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[8:-2] )
1 point
1
Question 16
16.
What is output by the following code?s = "www.apluscompsci.com";print( s[8:-4] )
What is output by the following code?
s = "www.apluscompsci.com";
print( s[8:-4] )
1 point
1
Question 17
17.
What is output by the following code?s = "www.apluscompsci.com";print( s.find("s") )
What is output by the following code?
s = "www.apluscompsci.com";
print( s.find("s") )
1 point
1
Question 18
18.
What is output by the following code?s = "www.apluscompsci.com";print( s.rfind("s") )
What is output by the following code?
s = "www.apluscompsci.com";
print( s.rfind("s") )
1 point
1
Question 19
19.
What is output by the following code?s = "www.apluscompsci.com";print( s.find("x") )
What is output by the following code?
s = "www.apluscompsci.com";
print( s.find("x") )
1 point
1
Question 20
20.
What is output by the following code?s = "www.apluscompsci.com";print( s.rfind("co") )
What is output by the following code?
s = "www.apluscompsci.com";
print( s.rfind("co") )