Python Flashcards
1
Q
What function is used to display something in the console?
A
print()
2
Q
How do you print variables a and b at once?
A
print(a,b)
3
Q
How do you start a new line in Python?
A
With \n
4
Q
How do you take input from the user in Python?
A
Using input()
5
Q
What do you use as a placeholder for future code?
A
pass
6
Q
How do you assign a and b to 1 and 2 in one line?
A
a, b = 1, 2.
7
Q
What is a, b = 1, 2?
A
Multiple assignment.
8
Q
How do you call a global variable?
A
global variable
9
Q
How do you repeat a string 3 times?
A
string * 3
10
Q
How do you find the quotient of a divided by b?
A
a // b
11
Q
How do find the remainder of a divided by b?
A
a % b
12
Q
How do you raise 2 to the power of 5?
A
2**5