D
D
Dima2021-06-06 22:12:22
Python
Dima, 2021-06-06 22:12:22

How to fix an error in a conditional statement?

age = int(input('How old are you? '))
procced = ('Do you want to play again?')

if age<18:
print('You lost!')
print(procced)

if procced == 'No':
breack

Error:
Traceback (most recent call last):
File "", line 1, in
No
NameError: name 'No' is not defined
>>>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-06-06
@interneterrorhehe

You didn't post all the code. And make out the code with the appropriate tag.
Everything is written in the description of the error. In the very first line of code (which you apparently didn't specify) you are accessing the No variable , which is not yet defined.
And " break " is spelled a little differently...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question