Operators Flashcards

1
Q

What is equal to in python?

A

==

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

What is not equal to in python?

A

!=

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

What is greater than in python?

A

>

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

What is less than in python?

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

What is less than or equal to?

A

<=

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

What is greater than or equal to in python?

A

> =

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

How do you assign a variable in python?

A

=

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

How do you do constant in python?

A

MY_CONSTANT

i.e. BIRTH_YEAR = 2003

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

How do you do variables in python?

A

my_variable

i.e.
not_guessed = True

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

What is user input in python?

A

INPUT

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

What is output in python?

A

OUTPUT

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

How do you convert to another data type in python?

A

str ()
int ()
float()

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

What is IF in python?

A

if answer == correct:

print (“Correct!”)

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

What is IF,ELSE in python?

A

if answer == correct:
print(“Correct!”)
else:
print(“Incorrect!”)

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

What is IF, ELIF, ELSE in python?

A
if answer == 5: 
   print("Correct!")
elif answer == 6:
     print ("Almost")
else:
      print("Incorrect!")
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is For loop in python?

A

for….in…..to…..
block of statements
end for

17
Q

What is while loop in python?

A

while not_guessed:

number = input ()

18
Q

How do you do subroutine in python?

A
def add (a,b):
       answer = a+b 
       print (answer)
19
Q

How do you return in python?

A

return answer

20
Q

How do you call a subroutine in python?

A

add(3, 4)

21
Q

How do you do assignment in python?

A

identifier = [item1, item2]

22
Q

How do you access an item on python?

A

animals[0]

23
Q

How do you update an item on python?

A

identifier[index] = “item”

24
Q

How do you do length of list on python?

A

len(identifier)