#Carlos Solano #Assignment 3, Problem 7 Software sales #Get user info software_purchased = raw_input("Enter the number of software items you want to buy: " ) software_purchased = int(software_purchased) print software_purchased #declare variables discount = 0 total = 0 software_price = 99 * software_purchased #Get the discount amount if software_purchased >= 100: discount = software_price * 0.50 elif software_purchased >= 50: discount = software_price * 0.40 elif software_purchased >= 20: discount = software_price * 0.30 elif software_purchased >= 10: discount = software_price * 0.20 total = software_price - discount #Print to user print "Price for software: $",software_price print "Total discount: $",discount print "Total Price: $",total
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