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

please help me , step by step explanation needed​
can someone help me with this?
This week, North Korea said it test-launched a hypersonic missile, but experts say the weapon was more likely to be what other type of missile? * ballistic lego
Guys, I’m giving you 81 points for you to answer to my last 2 weeks of my math word problem homework from The Hung Vuong Learning Centre Incorporated! So guys,
Hi in this dm where I have to write a falsely naive email I would like to denounce the lack of common interest of the French people but I don't know how to go a
44x^2 + 20x + 4 What is the Number of Terms? Hope someone answers :(
If two supplementary angles are 10x* and (2x-30)*, find the angles
PLEASE HELP!! T~T Write a 5-10 sentence summary of Rosa Parks` encounter on the bus. It can literally be 5-10 bullet point sentences, I don`t need a flowing des
Help me please!!!!!!!!!!!!!!!!!
Why india music is considered the oldest unbroken musical tradition?