Chapter 1: Print Function

In Python, we can print any query using the print function, and it supports both double quotes and single quotes for strings.

 

print("This is the first chapter")

Output: This is the first chapter

 

Note: We cannot use double quotes directly inside a string enclosed in double quotes, nor single quotes inside a string enclosed in single quotes. However, we can use single quotes inside double-quoted strings and double quotes inside single-quoted strings.

 

print("I"m reading the print function from Free Learning website.") #Error

print('I'm reading the print function from Free Learning website.') #Error

 

The error is highlighted in red above.