Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- product = input()
- if product == 'banana' or product == 'apple' \
- or product == 'kiwi' or product == 'cherry' or product == 'lemon' or product == 'grapes':
- print('fruit')
- elif product == 'tomato' or product == 'cucumber' or product == 'pepper' or product == 'carrot':
- print('vegetable')
- else:
- print('unknown')
- Фундаменталс решение:
- product = input()
- fruit = ['banana', 'apple', 'kiwi', 'cherry', 'lemon', 'grapes']
- vegetable = ['tomato', 'cucumber', 'pepper', 'carrot']
- if fruit.__contains__(product):
- print('fruit')
- elif vegetable.__contains__(product):
- print('vegetable')
- else:
- print('unknown')
Add Comment
Please, Sign In to add comment