Log in
Sign up for FREE
arrow_back
Library

Strings Test a

star
star
star
star
star
Last updated almost 2 years ago
20 questions
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Question 1
1.

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

Question 2
2.

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

Question 3
3.

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

Question 4
4.

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

Question 5
5.

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

Question 6
6.

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

Question 7
7.

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

Question 8
8.

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

Question 9
9.

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

Question 10
10.

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

Question 11
11.

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

Question 12
12.

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

Question 13
13.

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

Question 14
14.

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

Question 15
15.

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

Question 16
16.

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

Question 17
17.

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

Question 18
18.

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

Question 19
19.

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

Question 20
20.

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