Code:
x=[1,4,3,2]
y=('k',0,(1,5))
s="Text"
z=[1,4,s]
for x_elem in x:
print(x_elem, end=",")
print()
for y_elem in y:
print(y_elem, end=",")
print()
for z_elem in z:
print(z_elem, end=",")
print()
for s_elem in s:
print(y[0], end=",")
Output:
(a) How many variables are there in the above code block?
(b) What does the len() function of each variable return?
(c) What is the data types of each of the variables?
(d) What is stored in y[2][1]? y[0][0]?
2. Specification - Rewrite the quiz program so that it contains a list of questions and a
list of answers. They should be the same length. (Hard-coded)...take the example quiz and
ask and tally the questions the user got correct/wrong. Have at least 3 questions/answers.
What is 4 x 4? 1
Wrong 0/1
Final Correct Score 7/10