Test 2 Flashcards

1
Q

Pemdas true statements

A

right argument of the % operator cannot be zero

The ** operator uses right-sided binding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the output of this snippet

2, 4
x = int (input())
y = int (input())

x = x //y
y = y // x

print(y)

A

code causes input error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

output of the following snippet if the user enters two lines containing 3 and 6

x = input()
y = int(input())
print (x * y)

A

333333

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the value twenty point twelve ten raised to the power of eight written as

A

20.12E8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What two variable names are illegal

A

True

and

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the output of

y = 2 + 3 * 5.
print (y)

A

17.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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 % y

print(y)

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

the prefix 0o is

A

octal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

output of the following snippet if the user enters two lines 2 and 4 respectively

x = int(input())
y = int(input())

print(x + y)

A

6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

left-sided binding determines that the result of the following expression

1 // 2 * 3

A

0.166666666666666666

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

outputs any number of arguments including zero

A

print()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

x = 1 / 2 + 3 // 3 + 4 ** 2
print(x)

what is the output

A

17.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The \n diagraph forces the print() function to

A

break the output line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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 /

print(y)

A

8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

output of the following snippet

x = 1
x = 2
z = x
x = y
y = z
print(x, y)

A

2 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

output of the following snippet

z = y = x = 1
print(x, y, z, sep=’*’)

A

111

17
Q

output of

x = input()
y = input()
print(x + y)

A

24

18
Q

Argument name specified along with is value is the meaning of

A

keyword parameter

19
Q

What does the ** operator do

A

performs exponentation

20
Q

The result of 1 / 1

A

1.0