PE: Mod 2
Mod 2: Left-sided binding determines that the result of the following expression 1//2 * 3 is equal to:
0
Mod 2: What is the output of the following snippet if the user enters two lines containing 11 and 4 respectively? x = int(input()) y = int(input()) x = x % y x = x % y y = y % x print(y)
1
Mod 2: What is the output of the following statement? print(1,000,000)
1 0 0
Mod 2: What is the output of the following snippet? z = y = x = 1 print(x, y, z, sep = "*")
1*1*1
Mod 2: What is the output of the following snippet? x = 1 / 2 + 3 // 3 + 4 ** 2 print(x)
17.5
Mod 2: What is the output of the following snippet? x = 1 y = 2 z = x x = y y = z print(x, y)
2 1
Mod 2: The value twenty point twelve times ten raised to the power of eight should be written as:
20.12E8
Mod 2: What is the output of the following snippet if the user enters two lines containing 2 and 4 respectively? x = input() y = input() print(x + y)
24
Mod 2: What is the output of the following snippet if the user enters two lines containing 3 and 6 respectively? x = input() y = int(input()) print(x*y)
333333
Mod 2: What is the value of the following expression in Python 3? 2 * (3 - 1)
4
Mod 2: What is the output of the following snippet if the user enters two lines containing 2 and 4 respectively? x = int(input()) y = int(input()) print(x + y)
6
Mod 2: What is the output of the following piece of code if the user enters two lines containing 2 and 4 respectively? x = int(input()) y = int(input()) x = x/y y = y/x print(y)
8.0
Mod 2: The print() function can output values of:
Any number of arguments (including zero)
Mod 2: The \n digraph forces the print() function to:
Break the output line
Mod 2: A value is one of the basic things a program works with, like a letter or a number. Consider the values 1, 2, and "Hello World". These values belong to different types: 2 is an _______ and "Hello World" is a ________.
Integer, string
Mod 2: The result of the following division: 1/1
Is equal to 1.0
Mod 2: The 0o prefix means that the number after it is denoted as:
Octal
Mod 2: The ** operator:
Performs exponentiation
Mod 2: The meaning of the keyword parameter is determined by:
The argument's name specified along with its value
Mod 2: What is the output of the following snippet if the user enter two lines containing 2 and 4 respectively? x = int(input()) y = int(input()) x = x//y y = y//x print(y)
The code will cause a runtime error
Mod 2: What is the output of the following snippet? x = 2 + 3 * 5. print(X)
The snippet will cause an execution error
Mod 2: True or false: Variable names can be arbitrarily long. They can contain both letters and numbers but they can not start with a number.
True
Mod 2: The following script has two kinds of statements, an expression statement and an assignment statement. x = 2 print(x) Which line is an expression statement?
print(x)