age = 21 citizen = True if age >= 18 and citizen==True: print "You can vote" print "Congrats" else: print "You are not legally eligible to vote" print "EOE" amount = float(input("Amount of check: ")) nTip = amount * .15 pTip = amount * .25 print "Nice person tip: $" , nTip" print "PITA person tip: $" , pTip" family = ["Mark", "Brett", "Joan", "Rick", "Kerry", "Rose"] #print family #print family [1] #print family [:2] x = 0 while x < len(family): print family [x] x = x + 1
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