Save
...
mock
programing
operators
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
emily d
Visit profile
Cards (69)
What are operators used for in Python?
To perform operations on
variables
View source
When do we use operators to add or change variable values?
When we want to
modify
a variable's value
View source
What is the purpose of comparison operators in Python?
To compare
variable
values against something else
View source
What does the assignment operator '=' do in Python?
It assigns a value to a
variable
View source
How do you compare two variable values in Python?
Using
comparison operators
like
'>'
or
'<'
View source
If you want to check if variable A is greater than variable B, which operator would you use?
The
'>'
operator
View source
How does the '>' operator function in Python?
It checks if the left value is greater
View source
What does the expression '2 > 1' evaluate to?
True
View source
What does the expression '2 >= 2' evaluate to?
True
View source
What does the expression '1 < 2' evaluate to?
True
View source
What does the expression '1 <= 2' evaluate to?
True
View source
What is the output of '2 < 1' in Python?
False
View source
What does the expression '2 == 2' check for?
Equality
of two values
View source
What is the output of '2 == 1' in Python?
False
View source
What does the expression '2 != 1' evaluate to?
True
View source
What is the output of '2 != 2' in Python?
False
View source
What is the purpose of the 'input' function in Python?
To take
user input
View source
What does the 'print' function do in Python?
Displays
output
to the console
View source
How do you print the value of a variable named 'x' in Python?
Using
print(x)
View source
What is the syntax for defining a function in Python?
def
function_name()
:
View source
What is the purpose of the 'def' keyword in Python?
To define a new
function
View source
What is the output of 'print(2 + 2)' in Python?
4
View source
What does the expression 'input()' do in Python?
It waits for
user
input
View source
What is the output of 'print("Hello, World!")' in Python?
Hello, World!
View source
What does the expression 'input("Enter your name: ")' do?
Prompts
user
for their name
View source
What is the output of 'print(3 * 3)' in Python?
9
View source
What does the expression '3 * 3' evaluate to?
9
View source
What is the output of 'print(5 - 2)' in Python?
3
View source
What does the expression '5 - 2' evaluate to?
3
View source
What is the output of 'print(10 / 2)' in Python?
5.0
View source
What does the expression '10 / 2' evaluate to?
5.0
View source
What is the output of 'print(2 ** 3)' in Python?
8
View source
What does the expression '2 ** 3' evaluate to?
8
View source
What is the output of 'print(7 % 3)' in Python?
1
View source
What does the expression
'7
%
3'
evaluate to?
1
View source
What is the output of 'print(4 + 5 * 2)' in Python?
14
View source
What does the expression '4 + 5 * 2' evaluate to?
14
View source
What is the output of 'print((4 + 5) * 2)' in Python?
18
View source
What does the expression '(4 + 5) * 2' evaluate to?
18
View source
What is the output of 'print(10 - 3 + 2)' in Python?
9
View source
See all 69 cards