If statements Flashcards

1
Q

What are relational operators

A

Used within an if statement to indicate a comparison

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

Example of relational operators

A

Equal to –> ==
Not equal to –> !=
Less than –> <
Greater than –> >
Less than or equal to –> <=
Greater than or equal to –> >=

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

What happens if you want to use multiple if statements

A

Use an elif. Short for else if

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

What does the ‘in’ operator mean

A

Used to check if input is in the string

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