Last Updated on October 18, 2019 by Admin
PCAP – Programming Essentials in Python Quizzes Module 1 Test Answers
-
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
-
The meaning of the keyword parameter is determined by:
- its position within the argument list
- its value
- its connection with existing variables
- the argument’s name specified along with its value
-
The value twenty point twelve times ten raised to the power of eight should be written as:
- 20E12.8
- 20.12E8
- 20.12*10^8
- 20.12E8.0
-
The 0o prefix means that the number after it is denoted as:
- decimal
- binary
- octal
- hexadecimal
-
The ** operator:
- performs exponentiation
- performs duplicated multiplication
- does not exist
- performs floating-point multiplication
-
The result of the following division:
1 / 1
- is equal to 1
- cannot be evaluated
- cannot be predicted
- is equal to 1.0
-
Only one of the following statements is false – which one?
- multiplication precedes addition
- the result of the / operator is always an integer value
- the right argument of the % operator cannot be zero
- the ** operator uses right sided binding
-
Left‑sided binding determines that the result of the following expression
1 // 2 * 3
is equal to:
- 0.0
- 4.5
- 0
- 0.16666666666666666
-
One of the following variables’ names is illegal – which one?
- true
- tRUE
- True
- TRUE
-
The print() function can output values of:
- any number of arguments (excluding zero)
- just one argument
- any number of arguments (including zero)
- not more than five arguments
-
What is the output of the following snippet?
x=1
y=2
z=x
x=y
y=z
print(x,y)- 1 2
- 2 1
- 1 1
- 2 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)- 6
- 24
- 4
- 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())
x=x//y
y=y//x
print(y)- 2.0
- the code will cause a runtime error
- 4.0
- 8.0
-
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)- the code will cause a runtime error
- 8.0
- 4.0
- 2.0
-
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)- 3
- 2
- 1
- 4
-
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)- 36
- 18
- 333333
- 666
-
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?
x = 2 + 3 * 5.
print(X)- the snippet will cause an execution error
- 17
- 17.0
- 25.0
-
What is the output of the following snippet?
x = 1 / 2 + 3 // 3 + 4 ** 2
print(x)- 17
- 17.5
- 8.5
- 8
-
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)- 4
- 2
- 24
- 6