Python Programming - Tuples - Discussion

Discussion Forum : Tuples - General Questions (Q.No. 19)
19.
How do you create a tuple with the elements from 1 to 5?
new_tuple = (1, 2, 3, 4, 5)
new_tuple = tuple(range(1, 6))
new_tuple = (1 to 5)
new_tuple = [1, 2, 3, 4, 5]
Answer: Option
Explanation:
The range() function generates a sequence of numbers, and tuple() converts it to a tuple.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.