Tuples and Dictionary - Python C11
Tuples and Dictionary - Python C11
Permit different
Immutable / Permit duplicate
Ordered data type values
Read-only values
/ Heterogeneous
Tuple
# Singleton Tuple,
A tuple having a single element
Tuple
Tuple
>>>tup1 = (1, 2, 3, 4)
>>>tup1 [1:3] + (5,6)
(2, 3, 5, 6)
Q- WAP to create a tuple by accepting elements from the user using while loop
Tuple
Q- WAP to create a tuple by accepting elements from the user using for loop
Tuple
Q- WAP to create a tuple by accepting elements from the user using for loop
Alternative Question -
WAP to store ‘n’ number of school subjects in a tuple
Tuple
Q- WAP to create and display a nested tuple to store roll no., name and marks of
students.