1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
How can you determine the type of a variable?
Use the type function.
What is the data type of ‘this is what kind of data’?
string
What value is printed when the following statement executes?
print( int(53.785) )
53
What is printed when the following statements execute?
day = "Thursday"
day = 32.5
day = 19
print(day)
19
True or False: the following is a legal variable name in Python: A_good_grade_is_A+
false
What value is printed when the following statement executes?
print(18 / 4)
4.5
What value is printed when the following statement executes?
print(18 // 4)
4
What value is printed when the following statement executes?
print(18 % 4)
2
What is printed when the following statements execute?
n = input("Please enter your age: ")
# user types in 18
print ( type(n) )A. <class 'str'>
<class 'str'>
: Click on all of the variables of type int in the code below
seconds = input("Please enter the number of seconds you wish to convert")
hours = int(seconds) // 3600
total_secs = int(seconds)
secs_still_remaining = total_secs % 3600
print(secs_still_remaining)
hours, total_seconds, secs_still_remaining, total_secs, and secs_still_remaining
: Click on all of the variables of type str in the code below
hours = int(seconds) // 3600
total_secs = int(seconds)
secs_still_remaining = total_secs % 3600
print(secs_still_remaining)
seconds, seconds, seconds
What is the value of the following expression:
16 - 2 * 5 // 3 + 1
14
What is the value of the following expression:
2 ** 2 ** 3 * 3
768
After the following statements, what are the values of x and y?
x = 15
y = x
x = 22
x is 22 and y is 15
What is printed when the following statements execute?
x = 12
x = x - 1
print(x)
11
What is printed when the following statements execute?
x = 12
x = x - 3
x = x + 5
x = x + 1
print(x)
15