Simple If..else statement: code
cities = ['LA', 'Chicago', 'kansas city', 'columbia','Boston']
for city in cities:
if city == 'Boston':
if statement is an expression that can be evaluated as True or False and is called a conditional test.
If a conditional test evaluates to True, Python executes the code following the if statement. If the test evaluates to False, Python ignores the code following the if statement.
The simplest conditional test checks whether the value of a variable is equal to the value of interest.
== sign – check for True or False . Example.
if city == 'bmw':
Note: Conditional tests are CASE sensitive. CASE == case ‘False’, but CASE == CASE is True.