Perfect. Sometimes, more than one condition needs to be met in order to execute a part of code. To that end, we can use Boolean operators. The first operator we'll look at is
nationality = input('What is your nationality? ')
age = input('What is your age? ')
if (nationality == 'German' and int(age) > 25):
print('You are eligible to apply.')
print('Sorry, only German citizens above 25 can apply.')
The code above checks two conditions at the same time:
nationality must be equal to 'German'.
age must be greater than 25.
and, BOTH conditions must be met to execute the code after
if. If at least one of the conditions returns
False, the code after
else will be executed.