Module 1/2

Ace your homework & exams now with Quizwiz!

The result of the following division: 1 / 1

1.0 because it

One of the following variables' names is illegal - which one?

True

The ** operator:

performs exponentiation

What is the output of the following snippet if the user enters two lines containing 3 and 5 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 value of: 18 % 4 ** 2?

2

The print() function can output values of:

any number of arguments (including zero arguments)

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

binary

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? x = 1 / 2 + 3 // 3 + 4 ** 2 print(x)

17.5

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 need int() for numerics

What is the output of the following snippet? z = y = x = 4 print(x,y*z,sep='*',end="###")

4*16###

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

6 3

What is the output of the following snippet if the user enters two lines containing 3 and 6 respectively? x=int(input()) y=input() print(x*y)

666 x is int y is string

What is the output of the following snippet if the user enters two lines containing 3 and 5 respectively? x=int(input()) y=int(input()) print(x+y)

8

What is the output of the following piece of code if the user enters two lines containing 4 and 6 respectively? x=int(input()) y=int(input()) x=x/y y=y/x print(y)

9.0

What is the output of the following code? z = 43//2%6 print("The cow 'leapt' over the moon", z, 'times.')

The cow 'leapt' over the moon 3 times.

What is the output of the following statement? print("The cow jumped\nover the\\moon.")

The cow jumped over the\moon.

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

the result of the / operator is always an integer value

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

the snippet will cause an execution error case sensitive


Related study sets

ATI - Testing and Remediation Beginning Test

View Set

Chapter 01 Establishing a Framework for Business (1-4) BUSA 2105

View Set

A & P Ch 9 Muscles and Muscle Tissue

View Set

Chapter 2: The Basics of Medical Terminology Self Test

View Set

WGU Principles of Accounting VYC1

View Set

Mesolimbic dopamine system and reward

View Set