#age = input("how old are you?") favorite=raw_input ("what is your favorite book? No capitals please!") used=favorite genera="" distopia="The hunger games, the maze runner, legend, the giver, uglies, divergent, matched, eve, red rising" magickids="harry potter, i am number four, winter blue, percy jackson, the red peramid, city of masks, the masteryous benedict society, the tail of emily windsnap" adventure="graceling, lord of the rings, aragon, legend of the draw, narnia, the hobbit" alien="i am number four, rush, ander's game" femalecharacter="graceling, the circle, the hunger games, divergant, cinder, all these things i've done, eve" romance="the fault in our stars, matched, all these things i've done, twilghit, eve, shiver" dragon="aragon, lord of the rings, the hobbit, legend of the draw, game of thrones, the dragons of peren" classics="anne of green gables, oliver twist, little house on the prairie, peter pan" social="one summer together, the circle, the sisterhood of the travelling pants" knight="Gaceling, the hobbit, narnia, alanna, game of thrones" if favorite in distopia: genera=genera+destopia used=used+distopia if favorite in magickids: used=used+magickids genera=genera+magickids if favorite in adventure: used=used+adventure genera=genera+adventure if favorite in alien: used=used+alien genera=genera+alien if favorite in femalecharacter: used=used+femalecharacter genera=genera+femalecharacter if favorite in romance: used=used+romance genera=genera+romance if favorite in dragon: genera=genera+dragon used=used+dragon if favorite in classics: genera=genera+classics used=used+classics if favorite in social: genera=genera+social used=used+social if favorite in knight: genera=genera+knight used=used+Knight blue=genera.split(',') blue.remove("harry potter") ",".join(genera) print "Try these:", genera
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question