When I run this code from the Jupytr it works fine
n = 5
while n > 0 :
print(n)
n = n - 1
print(‘Blastoff!’)
on my command prompt on the console it gives me this error
When I run this code from the Jupytr it works fine
n = 5
while n > 0 :
print(n)
n = n - 1
print(‘Blastoff!’)
on my command prompt on the console it gives me this error
I am.
I think you are right.
How do I get to a python3 console
Please follow below steps for Python 3
source activate py36
python3
I get the same error
Rakesh ,
Looks like, the Python recognize the print(‘Blastoff!’) is inside the While loop, In that case the in intentation error makes it invalid syntax. So once you are done with your while loop have a blank line to end the while loop, and then have your print(‘Blastoff!’) .
n = 5
x = 10
while n > 0 :
print(n)
n = n - 1
print("Blastoff")