Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Select fruits
#python 3.5.2 table = [ {'fruit': 'apple'}, {'fruit': 'orange'}, {'fruit': 'kiwi'}, {'fruit': 'banana'} ] fruits = set((item["fruit"] for item in table)) try: user_input = "" while user_input != 'exit': user_input = input('> ') words = user_input.split() if words and words[0] == "select": for word in words[1:]: if word in fruits: print(word) break else: print("You didn't entered any fruit name in the table"); except Exception as e: print(e)
run
|
edit
|
history
|
help
0
PyISP
PYTHON 3
Overview
НОД по Евклиду на ПИТОНЕ
Python: Stack Simple I
one
Hello World Test
Short python input
test2.py
PyGuessTheNum