favorite_fruits = ['apple', 'orange', 'peach']
if'apple'in favorite_fruits:
print('You really like apple!')
if'orange'in favorite_fruits:
print('You really like orange!')
if'peach'in favorite_fruits:
print('You really like peach!')
if'bananas'in favorite_fruits:
print('You really like bananas!')
if'grape'in favorite_fruits:
print('You really like grape!')
5-8
users = ['mike', 'jace', 'admin', 'nancy', 'dave']
for user in users:
if user == 'admin':
print('Hello admin, would you like to see a status report?')
else:
print('Hello ' + user + ', thank you for logging in again')
5-9
users = ['mike', 'jace', 'admin', 'nancy', 'dave']
for user in users:
if user == 'admin':
print('Hello admin, would you like to see a status report?')
else:
print('Hello ' + user + ', thank you for logging in again')
ifnot users:
print('We need to find some users!')
users = []
ifnot users:
print('We need to find some users!')