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")
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")
Related Questions
The three greater than signs (>>>) are called the Python …………… .
- Cursor
- Command prompt
- Pointer
- Blinking cursor
Single-line comments in Python begin with …………… symbol.
- %
- "
- '''
- #
Python is a case-sensitive language. This means …………… .
- Capital and small letters are same for Python
- Python doesn't care about the case of alphabets
- Python treats capital and small letters as different
- Python automatically capitalizes the small letters
…………… mode of Python gives instant result of typed statement.
- Interactive mode
- Script mode
- Both Interactive and Script mode
- None of these