10

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?

12 Answers 12

18

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

Sign up to request clarification or add additional context in comments.

Comments

8

Python is case sensitive.

print('Hello World')

Comments

4

It seems that your "Print" has got the wrong casing. print should be in lowercase

Comments

3

It's not Print it's print. Lowercase p.

Comments

1

Use "print" instead of "Print".

Comments

1

Change Print to print(lower case p)

Comments

1

Python distinguishes uppercase and lowercase two different characters during execution. The reason for this is python doesn't want us to restrict the usages of identifiers and symbols to be used.

how to print hello world in python?

print('Hello World')

Comments

0

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")

1 Comment

The space is irrelevant here. (It is better coding style to remove it, but it doesn't affect the program's function in any way.) And the rest of the answer just duplicates what at least 5 people already said.
0

For printing Words on python should try this

print ("Your Words")

Comments

0

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

Comments

0

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

Comments

-1

please hover over run button and run as python file

2 Comments

what run button? In what application? Where in that application?
In vscode whenever you run the program just run the code as run as python file

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.