print "Welcome to this quiz. You are here to make desicions that are a matter of Life or Death." print print"You are." print my_age = 20 def female(): return "female" print female() def psychology(): return "Major's in psychology" print psychology() print "Now you are on your way to your class." print "54" print print "So instead of listening to the lecture I sit there and doodle math problems." addition = 38 + 21 subtraction = 39 - 12 multiplication = 939383 * 39339 division = 73 / 2 count_to = 39484 * 2983 print count_to masonjars = "Cupsofwater" print len(masonjars) masonjars = "Cupsofwater" print masonjars.upper() def greater_less_equal_10(answer): if answer > 10: return 1 elif answer < 10: return -1 else: return 0 bool_one = (5 <= 5) and "lakes" == "streams" bool_two = not not True or False and not True bool_three = False and not not True bool_four = True and not (False or False) bool_five = True or not False food = [ "bananas", "sauasages", "apples", "hotdogs"] outfit = ["earring","pants", "shoes"] for each in outfit: if each == "p": print outfit
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