Podcast
Questions and Answers
What is the primary function of the print()
function in Python?
What is the primary function of the print()
function in Python?
- To display output to the console (correct)
- To perform mathematical calculations
- To define a new variable
- To receive input from the user
Which data type is used to store whole numbers in Python?
Which data type is used to store whole numbers in Python?
- int (correct)
- str
- float
- bool
What does the len()
function do in Python?
What does the len()
function do in Python?
- It performs a mathematical operation.
- It converts a value to a string.
- It creates a new list.
- It returns the length of a string, list, or other sequence. (correct)
Which of the following is a correct way to write a comment in Python?
Which of the following is a correct way to write a comment in Python?
What is the purpose of an if
statement in Python?
What is the purpose of an if
statement in Python?