Quiz 2: How to write your first programs
What is the argument of the print() function in the following Python statement? print("My student ID is " + str(123456))
"My student ID is " + str(123456)
What is the value of my_num after the following statement executes? my_num = (50 + 2 * 10 - 4) / 2
33
What is the value of my_num after the following statements execute? my_num = 5 my_num += 20 my_num -= 12 my_num *= 0.5
6.5
What is the value of number after the following statement executes? number = (5 ** 2) * ((10 - 4) / 2)
75
Given: x = 23 , y = 15 What is the value of new_num after the following statement executes? new_num = x % y
8
Given: x = 23 , y = 15 What is the value of new_num after the following statement executes? new_num = x // y
NOT 1.533333!
Which of the following data types would you use to store the number 25.62?
float
Python relies on correct __________ to determine the meaning of a statement.
indentation
Which of the following doesn't follow the best naming practices for variables?
pRate
Given that pi = 3.1415926535, which of the following print() functions displays: pi = 3.14
print("pi =", round(pi, 2))