brooklynking1 brooklynking1
  • 21-01-2021
  • Computers and Technology
contestada

A loop that will output only the names that come before "Thor" in the alphabet from the names list.

Respuesta :

Cytokine
Cytokine Cytokine
  • 21-01-2021

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.

Answer Link

Otras preguntas

what crop did the people of the middle Colonies farm?​
Help last question!!! Please
I need to find the area of the shaded region, can anyone explain how to do it? ​
how do european's use the many rivers they have
need help filling in the blanks: selling price using markup.
Select all the francophone countries
Use the Law of Sines. Find b to the nearest tenth. a. 45.0 b. 81.4 c. 65.4 d. 90.4 Triangle CBA Line CB is 73 ∠B= 56°, ∠A=48°, b is a line between AC
if its ok, can anybody give me your opinion on what should be removed with a mathematical reason please.
Which of the fallowing best describes the population of Iceland
In the past 50 years the temperature on earth has increased true or false