How to print a statement in Python? | Python Basics


How to print a statement in Python?

Printing in Python means displaying a message (i.e. text, number, message etc.) on the screen. The syntax for the print() function is print("statement"). Inside the double or single quote, you have to type the text (i.e. your message) to print it on the screen. Either double or single quotes can be used to print the message on the screen. Example,

Using print function with double quotes
Input:

print("Welcome to vs.eyeandcontacts.com!")
Output:
Welcome to vs.eyeandcontacts.com!

Using print function with single quotes
Input:
print('Welcome to vs.eyeandcontacts.com!')
Output:
Welcome to vs.eyeandcontacts.com!


Also note that the print() function works with print typed in lowercase only. This function will not work if the print is written in other text case (other than the lowercase) such as Print or pRINT or PRINT. Doing so will result in an error.

Using print function with different text cases
Input:
Print('Welcome to vs.eyeandcontacts.com!')
pRINT('Welcome to vs.eyeandcontacts.com!')
PRINT('Welcome to vs.eyeandcontacts.com!')
Output:
Traceback (most recent call last): File "", line 1, in NameError: name 'Print' is not defined

No comments:

Post a Comment

Also read!

Click on any of the below text for additional links:

Class 6

Class 6 Computer Kips Solutions
Class 6 Gul Mohar English Solutions
→ Class 6 Map Pointing Solutions
Class 6 NCERT Civics Solutions
Class 6 NCERT Geography Solutions
Class 6 NCERT History Solutions
Class 6 NCERT Maths Solutions
Class 6 NCERT Science Solutions

Class 7

Class 7 Computer Kips Solutions
Class 7 Gul Mohar English Solutions
English Grammar Class 7
English Writing Skills Class 7
Class 7 Map Pointing Solutions
Class 7 NCERT Civics Solutions
Class 7 NCERT Civics Notes
Class 7 NCERT Civics Extra Questions
Class 7 NCERT Geography Solutions
Class 7 NCERT Geography Notes
Class 7 NCERT Geography Extra Questions
Class 7 NCERT History Solutions
Class 7 NCERT History Notes
Class 7 NCERT History Extra Questions
Class 7 NCERT Maths Solutions
Class 7 NCERT Science Solutions
Class 7 NCERT Science Notes
Class 7 NCERT Science Extra Questions

Class 8

Class 8 Kips Artificial Intelligence Solutions
Class 8 Gul Mohar English Solutions
English Grammar Class 8
English Writing Skills Class 8
Class 8 Map Pointing Solutions
Class 8 NCERT Civics Solutions
Class 8 NCERT Civics Notes
Class 8 NCERT Civics Extra Questions
Class 8 NCERT Geography Solutions
Class 8 NCERT Geography Notes
Class 8 NCERT Geography Extra Questions
Class 8 NCERT History Solutions
Class 8 NCERT History Notes
Class 8 NCERT History Extra Questions
Class 8 NCERT Maths Solutions
Class 8 NCERT Science Solutions
Class 8 NCERT Science Notes
Class 8 NCERT Science Extra Questions
Class 8 NCERT Science Exemplar
Class 8 NCERT Science MCQs

Class 9

Class 9 Kips Artificial Intelligence Solutions
Class 9 Map Pointing Solutions
Class 9 NCERT Civics Solutions
Class 9 NCERT Geography Solutions
Class 9 NCERT History Solutions
Class 9 NCERT Maths Solutions
Class 9 NCERT Science Solutions

Class 10

Class 10 Kips Artificial Intelligence Solutions
Class 10 NCERT English Solutions
→ Class 10 Map Pointing Solutions
Class 10 NCERT Civics Solutions
Class 10 NCERT Civics Notes
Class 10 NCERT Civics Extra Questions
Class 10 NCERT Geography Solutions
Class 10 NCERT Geography Notes
Class 10 NCERT Geography Extra Questions
Class 10 NCERT History Solutions
→ Class 10 NCERT History Notes
Class 10 NCERT History Extra Questions
Class 10 NCERT Maths Solutions
Class 10 NCERT Science Solutions
Class 10 NCERT Science Notes
Class 10 NCERT Science Extra Questions

Computer Languages

Python Basics

Extra Activities

Extra Activities

Extra Knowledge

Extra Information
General Knowledge
Historical Places in India
Latest technology
Physical Sciences
Facts

• Mathematics quick links
Mathematical Terms
Maths Tricks

Home Top