0
Stuck on While Loop Project
Ok I am supposed to make the computer count down from 100 to 1 then at zero say, "Blast Off!" And not run any more code. I was trying to follow along with this guy on YouTube right here: https://www.youtube.com/watch?v=ytXfaew7bCA He is a very good teacher, I am just not able to figure out what is wrong with my code. You see his. This is mine, if anyone can assist, thanks in advance. count = 100 While count > 1: print(count) count = count - 1 count = 100 While count >= 0 if count == 0 print("Blast Off!") else: Print(count) count = count - 1
5 Answers
+ 9
Pasted and edited
https://code.sololearn.com/cC6d8HQDcFkE/?ref=app
+ 8
Michelle Dobbs line up with print
print(count)
count = count - 1
if it is not aligned within the code properly you will get errors or bugs.
+ 1
I think you shouldn't write count=100 within while loop, which will reassign count to 100 every time you run the loop and thus generates an infinite loop.
Maybe you need something as Jay Matthews has suggested.
0
Thanks for your response. Yes, you are correct it wasn't aligned properly. I went back to try and fix it and honestly, I couldn't. I am very new to this and I am not even sure how this is supposed to be aligned. Not good. I need to go and find more information on how to align this. I don't recall it being addressed in my earlier lessons. Very disheartening. But thank you for your help.
0
Thanks guys so much for your help.