WorksheetsPython slicing
Total questions: 28
Worksheet time: 34mins
What is the output to the console for the featured program?
Esteban
Esteban Esteban
teban
steban
What will be the output for the program above?
<class 'tuple'>
<class 'list'>
<class 'set'>
<class 'dict'>
Which of the following prints the letter A?
What is the output to the console for the featured program?
Angel
ngel
gel
el
What is the output to the console for the featured program?
Tiffany
fany
Tif
Tiff
What is the output to the console for the featured program?
Samantha
mant
anth
ant
Which of the following prints the letter C?
What is the output to the console for the featured program?
8
len(name)
4
Samantha
What will be the output for the program above?
<class 'tuple'>
<class 'list'>
<class 'set'>
<class 'dict'>
What is the output to the console for the featured program?
8
len(Edua)
7
4
What is the output to the console for the featured program?
False
True
cat
concatenation
What is the output to the console for the featured program?
D
a
v
i
d
David
0
1
2
3
4
5
What is the output to the console for the featured program?
D
a
v
i
d
David
0
1
2
3
4
5
Which of the following prints the letter D?
What is the output to the console for the featured program?
False
True
cat
concatenation
Which of the following prints CDE?
What is the output to the console for the featured program?
J
e
r
m
a
v
i
Jermavi
0
1
2
3
m
a
v
i
Which of these pieces of code would return the name "Alex" from the following list?
nameList = ["Andrea", "Alex", "Xavier", "Jose", "Quaylan"]
nameList(1)
nameList[1]
nameList("Alex")
nameList["1"]
What is the output to the console for the featured program?
G
a
b
r
i
e
l
Gabriel
0
1
2
3
4
5
6
l
e
i
r
b
a
G
Which of the following prints ABCDE?
What is the correct way to concatenate the variable sign (sign = "Happy day!") to produce the following output?
expected output: “Happy Birthday!”
print(sign[:5] + "Birth" + sign[6:])
print(sign[:6] + "Birth" + sign[5:])
print(sign[:6] + "Birth" + sign[:6])
print(sign[:6] + "Birth" + sign[6:])
What is the output to the console for the featured program?
stress
desserts
dessert
stressed
What is the output to the console for the featured program?
spam
am
sp
maps
What will be the output of the code above?
['a', 'b', 'c', 'd', 'e']
['e', 'd', 'c', 'b', 'a']
['a', 'c', 'e']
['e', 'c', 'a']
What will be the output of the code above?
ADGJMPSVY
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ZYXWVUTSRQPONMLKJIHGFEDCB
ZYXWV
What will be the output of the code above?
ADGJMPSVY
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ACEGIKMOQSUWY
AEIMQ
What will be the output for the code above?
0
2
4
1
3
5
Kristina
Carmen
Olga
Ke'Nyiah
Evelyn
Isabel
Kristina
Olga
Evelyn
What will be the output for the code above?
0
2
4
1
3
5
Kristina
Carmen
Olga
Ke'Nyiah
Evelyn
Isabel
Kristina
Olga
Evelyn
