Log in
Sign up for FREE
arrow_back
Library

Strings Test a

star
star
star
star
star
Last updated about 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.

Question 2
2.

Question 3
3.

Question 4
4.

Question 5
5.

Question 6
6.

Question 7
7.

Question 8
8.

Question 9
9.

Question 10
10.

Question 11
11.

Question 12
12.

Question 13
13.

Question 14
14.

Question 15
15.

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") )

What is output by the following code?
s = "dog food";
print( s )
dog food
food
dog
food dog
What is output by the following code?
s = "www.apluscompsci.com";
print( s )
apluscompsci
www
com
www.apluscompsci.com
What is output by the following code?
s = "dog";
print( len(s) )
4
2
5
3
What is output by the following code?
s = "dog food";
print( len(s) )
8
4
7
3
What is output by the following code?
s = "www.apluscompsci.com";
print( len(s) )
10
20
15
12
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0] )
a
w
s
p
What is output by the following code?
s = "www.apluscompsci.com";
print( s[1] )
s
w
p
a
What is output by the following code?
s = "www.apluscompsci.com";
print( s[4] )
w
s
p
a
What is output by the following code?
s = "www.apluscompsci.com";
print( s[5] )
s
w
p
a
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:2] )
w.a
apl
www
ww
What is output by the following code?
s = "www.apluscompsci.com";
print( s[2:5] )
ww
www
w.a
apl
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:0] )
nothing
a
w
p
What is output by the following code?
s = "www.apluscompsci.com";
print( s[0:1] )
p
w
nothing
a
What is output by the following code?
s = "www.apluscompsci.com";
print( s[:-2] )
www.apluscompsci.co
www.apluscompsci.c
w.apluscompsci.com
www.apluscompsci.com
What is output by the following code?
s = "www.apluscompsci.com";
print( s[8:-2] )
apluscompsci.c
scompsci.c
scompsci
www.apluscompsci.com