'Python NameError: name 'Print' is not defined
I am running a print command on the interpreter that prints this error:
Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> Print ("Hello World")
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
Print ("Hello World")
NameError: name 'Print' is not defined
>>> Print ('Hello World')
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
Print ('Hello World')
NameError: name 'Print' is not defined
>>> Print("Hello World")
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
Print("Hello World")
NameError: name 'Print' is not defined
How can Print not be defined?
Solution 1:[1]
Function and keyword names are case-sensitive in Python. Looks like you typed Print where you meant print.
Solution 2:[2]
Python is case sensitive.
print('Hello World')
Solution 3:[3]
It's not Print it's print. Lowercase p.
Solution 4:[4]
It seems that your "Print" has got the wrong casing. print should be in lowercase
Solution 5:[5]
Print is nothing in python.
You mean print.
I think you need to remove the space between print and ("Hello World")
You mean print("Hello World")
Final code: print("Hello World")
Solution 6:[6]
Use "print" instead of "Print".
Solution 7:[7]
Change Print to print(lower case p)
Solution 8:[8]
For printing Words on python should try this
print ("Your Words")
Solution 9:[9]
It should be print(" ") with lower case p in print function
Python is a case sensitive language, so print and Print is 2 different function
Solution 10:[10]
As everybody highlighted Python is case sensitive and it should be print not Print, but I'm not going to repeat it. If you are new to python you can use Linting to highlight syntactical and stylistic problems in your Python source code.
Refer to this VS Code plugin for more details about linting: https://code.visualstudio.com/docs/python/linting
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
