IS290-Python essentials module 2 By test

Ace your homework & exams now with Quizwiz!

The result of the following division: 1 / 1 A. is equal to 1.0 B. cannot be evaluated C. cannot be predicted D. is equal to 1

A. is equal to 1.0

The 0o prefix means that the number after it is denoted as: A. octal B. hexadecimal C. decimal D. binary

A. octal

The ** operator: A. performs exponentiation B. performs floating-point multiplication C. performs duplicated multiplication D. does not exist

A. performs exponentiation

The meaning of the keyword parameter is determined by: A. the argument's name specified along with its value B. its value C. its connection with existing variables D. its position within the argument list

A. the argument's name specified along with its value

What is the output of the following snippet? y = 2 + 3 * 5. print(Y) A. the snippet will cause an execution error B. 17.0 C. 25. D. 17

A. the snippet will cause an execution error

The print() function can output values of: A. any number of arguments (excluding zero) B. just one argument C. not more than five arguments D. any number of arguments (including zero)

D. any number of arguments (including zero)

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. 2 C. 3 D. 4

A. 1

What is the output of the following snippet? x = 1 / 2 + 3 // 3 + 4 ** 2 print(x) A. 17.5 B. 8.5 C. 8 D. 17

A. 17.5

The value twenty point twelve times ten raised to the power of eight should be written as: A. 20.12E8 B. 20.12E8.0 C. 20E12.8 D. 20.12*10^8

A. 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. 24 B. 2 C. 4 D. 6

A. 24

Which of the following statements are true? (Select two answers) A. The right argument of the % operator cannot be zero. B. Addition precedes multiplication. C. The result of the / operator is always an integer value. D. The ** operator uses right-sided binding.

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

Which of the following variable names are illegal? (Select two answers) done A. and B. true C. TRUE D. True

A. and D. True

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

B. 1*1*1

The \n digraph forces the print() function to: A. stop its execution B. break the output line C. output exactly two characters: \ and n D. duplicate the character next to the digraph

B. break the output line

What is the output of the following? x = 1 y = 2 z = x x = y y = z print(x, y) A. 1 2 B. 1 1 C. 2 1 D. 2 2

C. 2 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) A. 666 B. 36 C. 333333 D. 18

C. 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) A. 4 B. 2 C. 6 D. 24

C. 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) A. the code will cause a runtime error B. 2.0 C. 8.0 D. 4.0

C. 8.0

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. 8.0 C. the code will cause a runtime error D. 2.0

C. the code will cause a runtime error

Left-sided binding determines that the result of the following expression: 1 // 2 * 3 is equal to: A. 0.16666666666666666 B. 0.0 C. 4.5 D. 0

D. 0


Related study sets

Econ 1 Test 2 Chapters 5-6, 7-8, 13

View Set

Graphing Lines in Slope-Intercept Form

View Set

31. Income Taxes (web, sch, cfa)

View Set

6.12 Unit Test: The Art of Policy making, Part 1

View Set

NR 464 - Exam 1 (Saunders) - Liver, Pancreas, Gallbladder

View Set