KnowledgeBoat Logo
|

Informatics Practices

Which of the following codes is correct?

1.

print("Programming is fun")
print("Python") 
print("Computer Science")

2.

print ("Programming is fun)
print("Python") 
print("Computer Science)

3.

Print("Programming is fun")
print("Python") 
print("Computer Science")

4.

Print("Programming is fun")
Print("Python") 
Print("Computer Science")

Getting Started

3 Likes

Answer

print("Programming is fun")
print("Python") 
print("Computer Science")

Reason — In Python, the print() function is written in lowercase (print) and strings must be enclosed in matching pairs of either single (') or double quotes ("). Therefore, the correct code would be :

print("Programming is fun")
print("Python") 
print("Computer Science")

Answered By

3 Likes


Related Questions