A

Admin • 832.70K Points
Coach

Q. How can you convert a list `l = [1, 2, 3]` into a tuple?

Code:
l = [1, 2, 3]
  • (A) tuple(l)
  • (B) list(l)
  • (C) set(l)
  • (D) dict(l)
  • Correct Answer - Option(A)
  • Views: 23
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

`tuple()` converts the list into a tuple.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.