Topic 2 Flashcards
The following expression is an example of what type of logic
spam = True
Boolean logic
What will the following integer and string expression evaluate to?
42 == ‘42’
False
Values for strings and integers will never be the same.
What will the following float and integer expression evaluate to?
42.0 == 42
True
What happens when the condition of an IF statement is True?
The next indented line will be executed by the program.
If the condition was false, the program would skip the next line.
What happens when the condition of an IF statement is False?
The program will move to the else statement and execute the code in that block.
If a user does not enter a value for a string and leaves it blank, would that evaluate to either True or False
False