- What is the value of the variable
total after the
segment below executes?
total = 0
for x in range(10):
total = total + x
#value here
- 50
- 55
- 60
- What is the value of
st after the code below executes?
st = ""
for x in "python":
st = x + st
#value here
- python
- nohtyp
- ptyohn
- What is the value of
st after the code below executes?
st = ""
for x in "python":
st = st + x*2
#value here
- ppyytthhoonn
- pythonpython
- nnoohhttyypp
- What is the value of
st after the code below executes?
st = ""
py = "python"
for x in range(1,7):
st = st + py[-x]
#value here
- python
- nohtyp
- arrgh
- A five letter word is printed by the code below, what is it?
words = ["self", "contained", "underwater", "breathing", "apparatus"]
abb = ""
for w in words:
abb = abb + w[1]
print abb
-
"scuba"
-
"eonrp"
-
"fdrgs"