"""====================================================================== Program: Tuition Projector Author: Chris Brockamp Date: April 15, 2015 Dev Env: Python Fiddle Description: Projects tuition cost per semester over the next five years at a 2% increase per year. ======================================================================""" #_declare constants______________________________________________________ TUITION_RATE = .02 TUITION = 6000 # dollars #_main___________________________________________________________________ print "Semester tuition year 1: $%.2f" % TUITION for year in range(2, 6): TUITION += TUITION * TUITION_RATE print "Semester tuition year {}: $%.2f".format(year) % TUITION
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