IMT 1313: Python Institute Module 2 Test

Ace your homework & exams now with Quizwiz!

Left-sided binding determines that the result of the following expression: 1 // 2 * 3 is equal to:

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)

1

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

1 x 1 x 1

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

17.5

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

2, 1

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

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)

24

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)

333333

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)

6

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

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

The ** operator uses right-sided binding The right argument of the % operator cannot be zero

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

and True

The print() function can output values of:

any number of arguments (including zero)

The \n digraph forces the print() function to:

break the output line

The result of the following division: 1 / 1

is equal to 1.0

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

octal

The ** operator:

performs exponentation

The meaning of the keyword parameter is determined by:

the argument's name specified along with its value

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)

the code will cause a runtime error

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

the snippet will cause an execution error


Related study sets

Chapter 10 - System Architecture

View Set

Chapter 20 Multiple Choice Question Bank- Exam 2

View Set

PEDS Exam 1 Course Point Practice Questions

View Set

Chapter 3: Creating Anglo-America

View Set