Someone pls help
I don't know how to do this I have went back and watched videos and everything they didn't help.
Then create the following:
A loop that will output every other name in the names list.
A loop that will output only the positive numbers in the numbers list.
A loop that will output the sum of all the values in the numbers list.
A loop that will output only the numbers that are odd.
A loop that will output only the names that come before "Thor" in the alphabet from the names list.
A loop that will find the maximum or minimum value in the numbers list. This algorithm requires an additional variable that is assigned to the first element in the list. Then, in a loop compare each element to the variable. If the element is > (for max) or < (for min), assign the variable to the element. After the loop, print the variable.
Use a for
loop
for name in names: print(name) for number in numbers: if number > 0: print(number) all = 0 for number in numbers: all += number print(all) for number in numbers: if number % 2 == 0: pass else: print(number) #thor is not in your list of names
What do you need help with exactly? I don't see any attempts in the attached repl.
@Kai_Justice All my attempts I deleted bc they didn't work d:
I don't understand exactly how to make the 6th loop,but I will try to do it, and will send it as soon as possible
Edit: I got it and here's how you would do it
If there are any errors when running this code please tell me and I will try to help, but anyways hope this helped you accomplish whatever you needed to.
@IntellectualGuy Dude you are such a hero. I just hope you know you saved me and my class grade bc I am simply retarded XD TYSM!
@BrendanD10 Np
@IntellectualGuy the questions asked for output all variables that come before the word "Thor" in the alphabet, so the word wanda wasn't supposed to be there. Could you show me how its done because my brain hurts.