Module 2 Flashcards
PCEP certification
The escape character owes its name to the fact that it:
A. changes the meaning of the character next to it
B. cannot be caught due to its high speed
C. escapes from the source files into the computer memory
A. changes the meaning of the character next to it
The meaning of the positional parameter is determined by its:
A. name
B. appearance
C. position
C. position
The most important difference between integer and floating-point numbers lies in the fact that:
A. they cannot be used simultaneously
B. integers cannot be literals, floats can
C. they are stored differently in the computer memory
C. they are stored differently in the computer memory
The 0x prefix means that the number after it is denoted as:
A. a hexadecimal
B. a decimal
C. an octal
A. a hexadecimal
The // operator:
A. performs regular division
B. performs integer division
C. does not exist
B. performs integer division
The result of the following addition:
123 + 0.0
A. cannot be evaluated
B. is equal to 123.0
C. is equal to 123
B. is equal to 123.0
Only one of the following statements is true - which one?
A. multiplication precedes addition
B. addition precedes multiplication
C. neither statement can be evaluated
A. multiplication precedes addition
Right-sided binding means that the following expression:
1 ** 2 ** 3
will be evaluated:
A. in random order
B. from left to right
C. from right to left
C. from right to left
A keyword is a word that: (Select two answers)
A. cannot be used as a variable name
B. is the most important word in the whole program
C. cannot be used as a function name
A. cannot be used as a variable name
C. cannot be used as a function name
A value returned by the input() function is:
A. a string
B. an integer
C. a float
A. a string
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)
A. 4.0
B. 2.0
C. 8.0
D. the code will cause a runtime error
D. the code will cause a runtime error
The 0o prefix means that the number after it is denoted as:
A. decimal
B. hexadecimal
C. binary
D. octal
D. octal
Which of the following variable names are illegal? (Select two answers)
A. true
B. and
C. TRUE
D. True
B. and
D. True
The result of the following division:
1 /1
A. cannot be predicted
B. is equal to 1.0
C. cannot be evaluated
D. is equal to 1
B. is equal to 1.0
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)
A. 18
B. 36
C. 666
D. 333333
D. 333333
The ** operator:
A. does not exist
B. performs floating-point multiplication
C. performs exponentiation
D. performs duplicated multiplication
C. performs exponentiation
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)
A. 1
B. 3
C. 4
D. 2
A. 1
The print() function can output values of:
A. any number of arguments (including zero)
B. just one argument
C. not more than five arguments
D. any number of arguments (excluding zero)
A. any number of arguments (including zero)
Which of the following statements are true? (Select two answers)
A. The result of the / operator is always an integer value.
B. The ** operator uses right-sided binding.
C. The right argument of the % operator cannot be zero.
D. Addition precedes multiplication.
B. The ** operator uses right-sided binding.
C. The right argument of the % operator cannot be zero.
What is the output of the following snippet?
z = y = x = 1
print(x, y, z, sep=’*’)
A. 111
B. 1 1 1
C. xyz
D. z y z
A. 111
The meaning of the keyword parameter is determined by:
A. its value
B. its connection with existing variables
C. the argument’s name specified along with its value
D. its position within the argument list
C. 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:
A. 20.12*10^8
B. 20.12E8
C. 20.12E8.0
D. 20E12.8
B. 20.12E8
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)
A. 2
B. 24
C. 6
D. 4
B. 24
What is the output of the following snippet?
x = 1 / 2 + 3 // 3 + 4 ** 2
print(x)
A. 17
B. 17.5
C. 8.5
D. 8
B. 17.5