Quiz on Tuples in Python
Q.1. Tuples can contain data of multiple data types
Q.2. What is the output of following program?
tup = ['America', 'Africa', 'Antartica', 'Alaska']
print(min(tup))
Q.3. What is the output of following program?
t1 = (1,2,3,4,5)
t2 = (6,7,8,9,10)
t = tuple(map(sum, zip(t1, t2)))
print(t)
Q.4. Which statement of the following is false?
Q.5. What is the output of following program?
t = (1, 2, 3, 4)
t.append( (5, 6, 7) )
print(len(t))
Q.6. Which of the following is the correct syntax to get "(76,23,16,42,89)" as output?
l = (78,54,76,23,16,42,89,12,56,87)
l = (78,54,76,23,16,42,89,12,56,87)
Q.7. Initializing a tuple as " t = [1,True,"Hello",5.6] " would not give an error
Q.8. With a list " t = ((1,(11,12)),((31,32),4),(5,6,(71,72))) ",
Which of the following will give output as 32?
Which of the following will give output as 32?
Q.9. What is the output of following program?
t = ("Vehicle",12,67.8)
print(type(t))
Q.10. What would be the output of following program?
t = (65,3,6,75,4,36,67,56,54)
t.pop()
print(t)
Q.11. Determine Output of the following snippet of code:
l = (45.7,12,35.8,True*3,32.8)
print(l[0]+l[1]+l[2])
Q.12. Whats the total number of elements, max number of rows and columns in the list given below:
t = ((1,(11,12)),((31,32),4),(5,6,(71,72)))
t = ((1,(11,12)),((31,32),4),(5,6,(71,72)))
Q.13. What will be the output of following program?
t = "Apple", 55, "Car", 67
a, b, c = t
print(b)
Q.14. What will be the output of following program?
t = (100,)
print(t * 5)
Q.15. What will be the output of following code:
t = (3,6,9,12,15,18)
print(tuple(sorted(t,reverse=True)))
Instructions:-
- This Quiz is based on Tuples in Python
- Each correct answer will carry 2 points
- Once an option is selected you cannot select any other, So choose wisely
- Do not refresh the page as it will reset the quiz
- Once the time is up the quiz will automatically get submitted with no of Question responded
- Your total score alongwith your name will be shown after submission of the Quiz
- Wish you ALL THE BEST 👍👍
START
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP