Question | Click to View Answer |
What does the following code print to the console? print("hi there")
|
The string "hi there" is printed to the console. The Python |
What does the following code print to the console? print("I am hungry")
# print("give me food!")
|
"I am hungry" is printed to the console, but "give me food!" is not printed. The pound sign (#) is used to make comments. Comments are added to code for human readers and aren't interpreted by Python. |
What does the following code print to the console? print(2 + 3)
|
The |
What does the following code print to the console? print(5 / 3)
|
Irrational numbers are automatically rounded. In this example, / is referred to as the operator. 5 and 3 are referred to as the operands. |
What does the following code print to the console? print(5 > 2)
|
In this example, > is referred to as the operator. 5 and 2 are referred to as the operands. |
What does the following code print to the console? print(5 + 6 / 3)
|
Python follows the order of operations, so division takes place before addition. Six is divided by three and the resulting quotient is added to five. |
What does the following code print to the console? print("sub" + "way")
|
The |
What does the following code print to the console? print("fantastic" + 4)
|
This code raises a |
What does the following code print to the console? print(3 + 4.5)
|
Python allows for the addition of integers and floating point numbers. |