Font size
WorksheetsMod 2 Test
Total questions: 20
Worksheet time: 11mins
What is the output of the following code?
y = 2 + 3 * 5.
print(Y)
error
25.
17
17.0
What is the output of the following code if the user enters two lines containing 2 and 4 respectively?
x = input()
y= input()
print (x +y)
2
24
4
6
The 0o prefix means that the numbers after it is denoted as:
binary
decimal
hexadecimal
octal
The print() function can outpur values of:
just one argument
not more than five arguments
any number of arguments (excluding zero)
any number of arguments (including zero)
The meaning of the keyword parameter is determined by:
Its positions within the argument list
its value
the argument's name specified along with its value
its connection with existing variables
Which of the following variable names are illegal?
select two
True
true
TRUE
and
What is the output of the following snippet (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)
4.0
error
2.0
8.0
The ** operator
preforms floating-point muliplication
preforms duplicated muliplication
preforms exponentiation
does not exist
The value twenty point twelve times ten raised to the power of eight should be written as:
20.12E8
20E12.8
20.12*10^8
20.12E8.0
What is the output of the following snippet(code)?
x = 1
y = 2
z = x
x = y
y = z
print (x, y)
2 1
1 1
2 2
1 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)
2
1
4
3
The result of the following division:
1/1
cannot be predicted
1.0
1
cannot be evaluated
What is the output of the following snippet?
x = 1 / 2 + 3 // 3 + 4 ** 2
print (x)
17.5
8.5
8
17
The \n digraph forces the print() function to:
output exactly two characters: \ and n
duplicate the character next to the digraph
stop its execution
break the output line
Which of the following statements are true?
Select two
the ** operation used right -sided binding
Addition precedes multiplication
the results of the / operator is always an integer value.
the right argument of the % operator cannot be zero.
What is the output of the following snippet if the user enters tow lines containing 3 and 6 respectively?
x = input()
y = int(input())
print (x*y)
333333
36
18
666
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)
2
24
4
6
What is the output of the following snippet?
z = y = x = 1
print(x,y,z, sep='*')
1*1*1
x y z
1 1 1
x*y*z
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())
x = x / y
y = y / x
print(y)
8.0
error
2.0
4.0
Left-sided binding determines that the result of the following expression:
1//2*3
is equal to:
0
0.0
4.5
0.16666666666
