David Khieu
Quiz by , created more than 1 year ago

PE1 -- Module 2 Quiz

105
0
0
David Khieu
Created by David Khieu over 1 year ago
Close

PE1 -- Module 2 Quiz

Question 1 of 30

1

The escape character owes its name to the fact that it?

Select one of the following:

  • changes the meaning of the character next to it.

  • escapes from source files into the computer memory

  • cannot be caught due to its high speed

Explanation

Question 2 of 30

1

The meaning of the positional parameter is determined by its:

Select one of the following:

  • position

  • appearance

  • name

Explanation

Question 3 of 30

1

The most important difference between integer and floating-point numbers lies in the fact that:

Select one of the following:

  • they are stored differently in the computer memory

  • integers cannot be literals, while floats can

  • they cannot be used simultaneously

Explanation

Question 4 of 30

1

The 0x prefix means that the number after it is denoted as:

Select one of the following:

  • a decimal

  • an octal

  • a hexadecimal

Explanation

Question 5 of 30

1

The // operator:

Select one of the following:

  • performs integer division

  • performs regular division

  • does not exist

Explanation

Question 6 of 30

1

The result of the following addition: 123 + 0.0

Select one of the following:

  • is equal to 123

  • is equal to 123.0

  • cannot be evaluated

Explanation

Question 7 of 30

1

Right-sided binding means that the following expression:
1 ** 2 ** 3

Select one of the following:

  • from right to left

  • from left to right

  • in random order

Explanation

Question 8 of 30

1

A keyword is a word that: (Select two answers)

Select one of the following:

  • is the most important word in the whole program

  • cannot be used as a variable name

  • cannot be used as a function name

Explanation

Question 9 of 30

1

A value returned by the input() function is

Select one of the following:

  • a string

  • an integer

  • a float

Explanation

Question 10 of 30

1

Only which one of the following statements is true - which one?

Select one of the following:

  • multiplication precedes addition

  • addition precedes multiplication

  • neither statement can be evaluated

Explanation

Question 11 of 30

1

What is the output of the following snippet?
y = 2 + 3 * 5
print (Y)

Select one of the following:

  • 17.0

  • 25.

  • 17

  • This snippet will cause an execution error

Explanation

Question 12 of 30

1

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)

Select one of the following:

  • 4.0

  • 2.0

  • this code will cause a runtime error

  • 8.0

Explanation

Question 13 of 30

1

What is the output of the following snippet?
x = 1 / 2 + 3 // 3 + 4 ** 2
print (x)

Select one of the following:

  • 17.5

  • 17

  • 8.5

  • 8

Explanation

Question 14 of 30

1

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)

Select one of the following:

  • 2

  • 24

  • 4

  • 6

Explanation

Question 15 of 30

1

The 0o prefix means that the number after it is denoted as:

Select one of the following:

  • binary

  • hexadecimal

  • octal

  • decimal

Explanation

Question 16 of 30

1

What is the output of the following snippet?
x = 1
y = 2
z = x
x = y
y = z
print (x, y)

Select one of the following:

  • 2 1

  • 1 2

  • 1 1

  • 2 2

Explanation

Question 17 of 30

1

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)

Select one of the following:

  • 4

  • 3

  • 2

  • 1

Explanation

Question 18 of 30

1

What is the output of the following snippet?
z = y = x = 1
print (x, y , z, sep='*')

Select one of the following:

  • 1 1 1

  • x*y*z

  • x y z

  • 1*1*1

Explanation

Question 19 of 30

1

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)

Select one of the following:

  • 666

  • 18

  • 36

  • 333333

Explanation

Question 20 of 30

1

The print() function can output values of:

Select one of the following:

  • just one argument

  • any number of arguments (including zero)

  • not more than five arguments

  • any number of arguments (excluding zero)

Explanation

Question 21 of 30

1

The value twenty point twelve times ten raised to the power of eight should be written as:

Select one of the following:

  • 20.12E8

  • 20E12.8

  • 20.12*10^8

  • 20.12E8.0

Explanation

Question 22 of 30

1

The ** operator:

Select one of the following:

  • performs exponentiation

  • does not exist

  • performs floating-point multiplication

  • performs duplicated multiplication

Explanation

Question 23 of 30

1

The result of the following division:
1 / 1

Select one of the following:

  • is equal to 1

  • cannot be evaluated

  • is equal to 1.0

  • cannot be predicted

Explanation

Question 24 of 30

1

The \n digraph forces the print () function to

Select one of the following:

  • break the output line

  • output exactly two characters: \ and n

  • duplicate the character next to the digraph

  • stop its execution

Explanation

Question 25 of 30

1

The meaning of keyword parameter is determined by:

Select one of the following:

  • the argument's name specified along with its value

  • its connection with existing variables

  • its position within the argument list

  • its value

Explanation

Question 26 of 30

1

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)

Select one of the following:

  • 24

  • 4

  • 2

  • 6

Explanation

Question 27 of 30

1

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)

Select one of the following:

  • 2.0

  • 4.0

  • the code will cause a runtime error

  • 8.0

Explanation

Question 28 of 30

1

Left-sided binding determines that the result of the following expression:

1 // 2 * 3

is equal to:

Select one of the following:

  • 0.166666666666666666

  • 0

  • 0.0

  • 4.5

Explanation

Question 29 of 30

1

Which of the following statements are true? (Select two answers)

Select one or more of the following:

  • Addition precedes multiplication

  • 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.

Explanation

Question 30 of 30

1

Which of the following variable names are illegal? (Select two answers)

Select one or more of the following:

  • True

  • and

  • TRUE

  • true

Explanation