#!/usr/bin/env python # this program is designed to introduce grade 9 students # to some topics of linear equations # it is based on a group problem found on my website # at https://www.markrussell.name/teaching/ # email: mrussell@ebrschools.org # Students will be expected to write this as a function # using PyCharm community edition as a homework exercise # get values for the input variable and constants according to # the instructions on the group handout # input the per unit sales price in x.xx format unitSP = float(raw_input("Enter a per unit sales price: ")) # input the number of units sold as an integer numS = int(raw_input("Enter the number of units sold: ")) # input the fixed costs calculated in the group work # session in x.xx format fixedC = float(raw_input("Enter the fixed costs: ")) # calculate the profit calcP = unitSP * numS - fixedC # output the input data and the # associated calculated output data print "For per unit sales price = $", unitSP, " and,\n" print "number of units sold = ", numS, " and, \n" print "fixed costs = $", fixedC, ",\n" print "I should realize a profit of $", calcP, "." # using the results of your calculations # answer the questions in you group handout
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