Quiz
PE1 -- Module 2 Quiz
Questions in this quiz (30)
1The escape character owes its name to the fact that it?
- Achanges the meaning of the character next to it.
- Bescapes from source files into the computer memory
- Ccannot be caught due to its high speed
2The meaning of the positional parameter is determined by its:
- Aposition
- Bappearance
- Cname
3The most important difference between integer and floating-point numbers lies in the fact that:
- Athey are stored differently in the computer memory
- Bintegers cannot be literals, while floats can
- Cthey cannot be used simultaneously
4The 0x prefix means that the number after it is denoted as:
- Aa decimal
- Ban octal
- Ca hexadecimal
5The // operator:
- Aperforms integer division
- Bperforms regular division
- Cdoes not exist
6The result of the following addition: 123 + 0.0
- Ais equal to 123
- Bis equal to 123.0
- Ccannot be evaluated
7Right-sided binding means that the following expression:
1 ** 2 ** 3- Afrom right to left
- Bfrom left to right
- Cin random order
8A keyword is a word that: (Select two answers)
- Ais the most important word in the whole program
- Bcannot be used as a variable name
- Ccannot be used as a function name
9A value returned by the input() function is
- Aa string
- Ban integer
- Ca float
10Only which one of the following statements is true - which one?
- Amultiplication precedes addition
- Baddition precedes multiplication
- Cneither statement can be evaluated
11What is the output of the following snippet?
y = 2 + 3 * 5
print (Y)- A17.0
- B25.
- C17
- DThis snippet will cause an execution error
12What 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)- A4.0
- B2.0
- Cthis code will cause a runtime error
- D8.0
13What is the output of the following snippet?
x = 1 / 2 + 3 // 3 + 4 ** 2
print (x)- A17.5
- B17
- C8.5
- D8
14What 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)- A2
- B24
- C4
- D6
15The 0o prefix means that the number after it is denoted as:
- Abinary
- Bhexadecimal
- Coctal
- Ddecimal
16What is the output of the following snippet?
x = 1
y = 2
z = x
x = y
y = z
print (x, y)- A2 1
- B1 2
- C1 1
- D2 2
17What 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)- A4
- B3
- C2
- D1
18What is the output of the following snippet?
z = y = x = 1
print (x, y , z, sep='*')- A1 1 1
- Bx*y*z
- Cx y z
- D1*1*1
19What 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)- A666
- B18
- C36
- D333333
20The print() function can output values of:
- Ajust one argument
- Bany number of arguments (including zero)
- Cnot more than five arguments
- Dany number of arguments (excluding zero)
21The value twenty point twelve times ten raised to the power of eight should be written as:
- A20.12E8
- B20E12.8
- C20.12*10^8
- D20.12E8.0
22The ** operator:
- Aperforms exponentiation
- Bdoes not exist
- Cperforms floating-point multiplication
- Dperforms duplicated multiplication
23The result of the following division:
1 / 1- Ais equal to 1
- Bcannot be evaluated
- Cis equal to 1.0
- Dcannot be predicted
24The \n digraph forces the print () function to
- Abreak the output line
- Boutput exactly two characters: \ and n
- Cduplicate the character next to the digraph
- Dstop its execution
25The meaning of keyword parameter is determined by:
- Athe argument's name specified along with its value
- Bits connection with existing variables
- Cits position within the argument list
- Dits value
26What 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)- A24
- B4
- C2
- D6
27What 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)- A2.0
- B4.0
- Cthe code will cause a runtime error
- D8.0
28Left-sided binding determines that the result of the following expression:
1 // 2 * 3
is equal to:- A0.166666666666666666
- B0
- C0.0
- D4.5
29Which of the following statements are true? (Select two answers)
- AAddition precedes multiplication
- BThe result of the / operator is always an integer value.
- CThe right argument of the % operator cannot be zero
- DThe ** operator uses right-sided binding.
30Which of the following variable names are illegal? (Select two answers)
- ATrue
- Band
- CTRUE
- Dtrue
Information
- Description
- PE1 -- Module 2 Quiz
- Author
- David Khieu
- Language
- English
- Views
- 163
- Tags
- Rating
- No ratings yet Rate this quiz