Question #247

What is the type of the object below?
(1.0,)

(1.0,) is a tuple containing the float 1.0 . When generating a one-element tuple, if you write only one object in parentheses (), the parentheses () are ignored and not considered a tuple. To generate a one-element tuple, a comma , is required at the end. (note.nkmk.me/en/python-tuple-single-empty)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵