49. Problem to create a set of favorite movies

In this Python set program, we will create a set of favorite movies with the help of the below-given steps.

What is set?
Sets are used to store multiple items in a single variable.
The set is one of 4 built-in data types in Python used to store collections of data.
It is an unordered collection data type that is iterable, mutable and has no duplicate elements.

Set of favorite movies:

Steps to solve the program

1. Create a set using {}.
2. Add name of your favorite movies in the set.
3. Print the set to see the output.

				
					Set = {"Avengers: Endgame","John wick","The Matrix"}
print("Set of movies: ",Set)
				
			

Output :

				
					Set of movies:  {'John wick', 'The Matrix', 'Avengers: Endgame'}
				
			

Related Articles

create a set of your favorite actors.

create two sets of books and find the intersection of sets.

Leave a Comment