A set of commands which can be run by calling it by name.
Function
Keyword used to join test conditions in if statements.
Boolean
The symbols used to compare values in true/false tests.
Relational Operators
Command that tests a true/false condition.
If statement
Information sent to a function.
Parameter
Tests if both conditions are true.
And
day = input("What day of the week is it?")
if we do new lessons on mondays and wednesdays, what is the condition that will check if an input variable given for the day of the week is a new lesson day?
day == monday or day == wednesday
Used to let the program choose between two true/false options, happens when the if statement is false.
Else
A precise set of rules for how to solve a problem.
Algorithm
Takes the opposite.
Not
An academic grade is usually from 0% to 100%
What condition will test if a percent score is a valid academic grade?
grade >= 0 and grade <= 100
Tests a second (or third, or fourth...) condition in an if statement.
elif
If the user enters AnAcOnDa as the input variable, word, is the condition met:
word.upper() == "ANACONDA"
yes
Tests if at least one condition is true.
Or
What condition checks that num1 and num2 are not the same value?
num1 != num2
Putting one if statement inside another.
Nested ifs
The set of rules that guide what is correct code for the compiler to run.
Syntax
How did Booleans get their name?
The mathematician they were named after's last name is Boole
What condition could be written to check if a number is from 10 to 20, inclusive?
remember:
< > <= >= == !=
num >= 10 and num <= 20
condition to test if a case-insensitive word is hello
word.lower() == "hello"