Python Flashcards

1
Q

What function is used to display something in the console?

A

print()

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

How do you print variables a and b at once?

A

print(a,b)

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

How do you start a new line in Python?

A

With \n

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

How do you take input from the user in Python?

A

Using input()

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

What do you use as a placeholder for future code?

A

pass

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

How do you assign a and b to 1 and 2 in one line?

A

a, b = 1, 2.

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

What is a, b = 1, 2?

A

Multiple assignment.

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

How do you call a global variable?

A

global variable

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

How do you repeat a string 3 times?

A

string * 3

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

How do you find the quotient of a divided by b?

A

a // b

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

How do find the remainder of a divided by b?

A

a % b

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

How do you raise 2 to the power of 5?

A

2**5

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