A loop that will output only the names that come before "Thor" in the alphabet from the names list.
1 answer:
names = ["Kevin", "Joe", "Thor", "Adam", "Zoe"]
names.sort()
for x in names:
if x == "Thor":
break
else:
print(x)
I made up my own names for the sake of testing my code. I wrote my code in python 3.8. I hope this helps.
You might be interested in
Answer:
WordArt
Explanation:
Took exam
Sometimes they just beep for no reason or the batteries are faulty
Explanation:
6579689993 and password is 3250 I RISHAVjoin please I join yar
A part-time job would provide on-the-job experience while also giving him a flexible schedule competing with school.