• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
August 10, 2022 |23.5K Views
Python Program to Convert Set into a List
  Share   Like
Description
Discussion

In this video, we will write a program to Convert set into a list in Python Program

Below is the list of approaches that we will cover in this section:
1. Getting the elements using list()
2. Getting the element using sorted() method

Python list() function takes any iterable as a parameter and returns a list (iterable is an object that could be a sequence (string, tuples) or collection). 

The another method we are going to cover is sorted() method, this will convert the set into list in a defined order. The only drawback of this method is that the elements of the set need to be sortable, and it return only unique number.

Python | Convert set into a list
https://www.geeksforgeeks.org/python-convert-set-into-a-list/

Read More