Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python NameError: name 'Print' is not defined

Tags:

python

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?

like image 367
ZWD Avatar asked Mar 15 '11 01:03

ZWD


2 Answers

Function and keyword names are case-sensitive in Python. Looks like you typed Print where you meant print.

like image 98
dcrosta Avatar answered Oct 04 '22 17:10

dcrosta


Python is case sensitive.

print('Hello World')

like image 41
John Percival Hackworth Avatar answered Oct 04 '22 19:10

John Percival Hackworth