+ 1
How to access element from sets in Python?
courses = {'Math', 'Science', 'Art'}
12 Antworten
+ 4
In wich language? Please write a more clear question to get faster answers.
+ 4
Aakash Gupta You're welcome!
+ 3
Review this lesson please:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2464/?ref=app
+ 3
https://stackoverflow.com/q/59825/9541900
+ 1
done check it out... I am asking for python
+ 1
there is no answer what I asked.. if I want it's first element then how we can access?
+ 1
yes! I want help.
+ 1
courselist=sorted(list(courses))
I normally change it into a sorted list. Then you know, there are no duplicates and they are all in alphabetical order.
courselist[0]
will give 'Arts'
Other way.
for course in courses:
print(course)
0
anyone wanna link
0
Michael Peters thanks it's help.. way is a little different but helpful.
0
pardon ! didn't understand
0
yes! and thank you 😊 Louis