Hi everyone I am a beginner in python.
I am trying to code a simple script which counts 1 to 10 leaving 5 but i am getting this error:
>>> count = 0
>>> while true:
... count += 1
... if count > 10:
... break
... if count == 5:
... continue
... print(count)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'true' is not defined
>>> input("\nPress the enter key to exit.")
Press the enter key to exit.
I have take example of other code as well it works fine but the code that i typed does not work fine.
why it is happening
i am using edsharp to type these code.
i am using python
3.7.2
in windows 10 with nvda
below i have posted my own code and the code from which i took reference
my own code::
count = 0
while true:
count += 1
if count > 10:
break
if count == 5:
continue
print(count)
input("\nPress the enter key to exit.")
reference code::
count = 0
while True:
count += 1
if count > 10:
break
if count == 5:
continue
print(count)
input("\n\nPress the enter key to exit.")
please help.
due to these errors i am not being able to learn. python