Python: Making a Set

Post Reply
User avatar
Jason
Site Admin
Posts: 767
Joined: Sun Dec 21, 2025 8:56 pm

Code: Select all

# Sets are unordered, with no duplicates and elements can be modified.

set_of_some_odd_numbers = {3, 11, 9, 7, 15}

print(set_of_some_,odd_numbers)

set_of_some_US_city_names = set(("Miami", "Chicago", "Los Angeles"))

print(set_of_some_US_,city_names)
 

POSTREACT(ions) SUMMARY

Post Reply