P

Priyanka Tomar • 35.28K Points
Coach

Q. Which of the following is the correct way to create a set in Python?

  • (A) set = [1, 2, 3]
  • (B) set = {1, 2, 3}
  • (C) set = (1, 2, 3)
  • (D) set = [1; 2; 3]
  • Correct Answer - Option(B)
  • Views: 173
  • Filed under category Python

Explanation by: Priyanka Tomar
In Python, sets are created using curly braces: set = {1, 2, 3}.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics