Can you expand a bit on question 2? If I were to convert a list into a tuple, I would probably throw the list right at the tuple constructor:
>>> my_list = [1, 2, 3] >>> my_tuple = tuple(my_list) >>> my_tuple (1, 2, 3)
The answer provided seems to be answering a different question.
I agree with that. I run the code, and this is the result.
>>> print(my_tuple) (50, 'Eighty', 9)
But the real answer should be something like this:
(50, 'Twenty', 110, 'Fifty', 'Ten', 20, 10, 80, 'Eighty')
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Can you expand a bit on question 2? If I were to convert a list into a tuple, I would probably throw the list right at the tuple constructor:
The answer provided seems to be answering a different question.
I agree with that. I run the code, and this is the result.
But the real answer should be something like this: