What causes the program to display python name error name 'ture' is not defined?

Asked 2 years ago, Updated 2 years ago, 30 views

I am a person with a python experience of 3 months.No matter how many times I rewrite it

 python name error name 'ture' is not defined

appears.

By the way, this computer is Windows 7, is that relevant?

python

2022-09-30 21:48

1 Answers

Maybe it's because the spelling is wrong and the first t is not uppercase? Try changing it to True.

addition:

There seems to have been a similar question in the past as follows.
The python program gets an error saying "NameError: name 'true' is not defined"

If you really wanted to use this name ture, you might have tried to substitute a value without predefined or initialized it, or you might have tried to specify it as a function or method parameter.

The error message itself should have more lines, and there should be information such as how many lines (and even how many digits) of the source code are occurring.

Add the source code you are trying to run, test data you are using, and any error messages you are experiencing to your questionnaire.

If they are huge and difficult to publish, try reducing them to a minimum size while reproducing the problem.

Surprisingly, you can identify the cause by yourself during these tasks.


2022-09-30 21:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.