Computer Science
Which of the following is/are correctly declared tuple(s) ?
- a = ("Hina", "Mina", "Tina", "Nina")
- a = "Hina", "Mina", "Tina", "Nina")
- a = ["Hina", "Mina", "Tina", "Nina"]
- a = (["Hina", "Mina", "Tina", "Nina"])
Related Questions
Choose the correct statement(s).
- Both tuples and lists are immutable.
- Tuples are immutable while lists are mutable.
- Both tuples and lists are mutable.
- Tuples are mutable while lists are immutable.
Choose the correct statement(s).
- In Python, a tuple can contain only integers as its elements.
- In Python, a tuple can contain only strings as its elements.
- In Python, a tuple can contain elements of different types.
- In Python, a tuple can contain either string or integer but not both at a time
Which of the following will create a single element tuple ?
- (1,)
- (1)
- ( [1] )
- tuple([1])
What will be the output of following Python code?
tp1 = (2,4,3) tp3 = tp1*2 print(tp3)
- (4,8,6)
- (2,4,3,2,4,3)
- (2,2,4,4,3,3)
- Error