Complete the code to create a single-element tuple with the number 5.
single_element = (5[1])
In Python, a single-element tuple must have a comma after the element inside the parentheses.
Complete the code to create a single-element tuple containing the string 'hello'.
greeting = ('hello'[1])
The comma after 'hello' makes it a single-element tuple instead of just a string in parentheses.
Fix the error in the code to correctly create a single-element tuple with the value 10.
number = (10[1])
The comma after 10 is required to make it a single-element tuple.
Complete the code to create a single-element tuple with the boolean value True.
flag = ([1],)The value True followed by a comma inside parentheses creates a single-element tuple.
Fill both blanks to create a single-element tuple with the float 3.14 and print its type.
pi = ([1],) print(type([2]))
3.14 with a comma inside parentheses makes a single-element tuple. Printing type(pi) shows it is a tuple.