+ 4
I don't know why this particular python code is not running
5 Réponses
+ 1
Slak and Amarie are correct
and to fix the while statement I added a try and except
I've edited it. Once you've fixed yours I'll delete this:
https://code.sololearn.com/c1WgK4DjdgjV/?ref=app
+ 4
@Slak, you can use ";" in python to do things like that :
i=0
j=1
while i<5:
j*=2;i+=1
+ 3
Well there is a lot of problems firstly some of your code is not properly indented.
Indentation is very important in python
Secondly I saw a ';' in there somewhere
Python dont use ';' after the lines of code
Thirdly some of your elif statements don't have a ':' after them
But just look at what the compiler give as a error, Python is very good at giving meaningful error messages
+ 3
I would suggest you to start with fixing this large number of indentation errors. Futher 'while True' is really bad style and you should remove semicolons after statements because this isn't done in python...
+ 3
Nice I didn't know that :)
Thanks for teaching me something new