When we learn Python there lies certainly inbuilt data structures which come with python. Some of the in-built data structures are Lists, Tuples and Dictionaries. With the help of data structures, the handling of data becomes easier and chances of data loss decreases.
In this Python quiz, we will try to check our concepts about the Python Tuples. All the best!
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
What will be the output of the following code? # Code Snippe Start
val = (1,2,3,1,2,2,2,3,4,5) print(list(val).count(2), end=” “) print(list(set(val)).count(2))
# Code Snippet End
Correct
Incorrect
Question 11 of 15
11. Question
What will be the output of the following code? # Code Snippe Start
l = [abs(i*2-15) for i in range(9,19)] l = tuple(l)
print(l)
# Code Snippet End
Correct
Incorrect
Question 12 of 15
12. Question
What will be the output of the following code? # Code Snippe Start
l = (2,7,8,9,2,4,3,1,4,2,7) l = set(l)
print(type([tuple(l)]))
# Code Snippet End
Correct
Incorrect
Question 13 of 15
13. Question
What will be the output of the following code snippet? # Code Snippe Start
s = ‘QuizOrbit’ s = tuple(s)
print(s)
# Code Snippet End
Correct
Incorrect
Question 14 of 15
14. Question
Find the output of the following given code? # Code Snippe Start
s = ‘Quiz Orbit’ s= s.split(” “) s = tuple(s)
print(s)
# Code Snippet End
Correct
Incorrect
Question 15 of 15
15. Question
Find the output of the code given below? # Code Snippe Start
v1 = (2,3,8,7) v2 = (7,3,9,1,2)
i = 0 v3 = [] for ele in v1: v3.append(ele+v2[i]) i+=1 v3 = tuple(v3) print(max(v3))
# Code Snippet End
Correct
Incorrect
Summary
This is the end of Python quiz on Tuples. Tuples are one of the important inbuilt data structures available to users in the Python Language. They are immutable and thus are useful for storing data that doesn’t require modifications frequently. We emphasise clearing the concepts included before moving ahead. Happy Learning!