#set up variables and quatities cars = 44 space_in_a_car = 4.0 drivers = 15 passengers = 200 cars_not_driven = cars - drivers cars_driven = drivers carpool_capacity = cars_driven * space_in_a_car average_passengers_per_car = passengers / cars_driven #report the computations print "There are ",cars, "cars available" print "There are only ",drivers, "drivers available" print "There will be ",cars_not_driven, "empty cars today" print "We can transport ",carpool_capacity, "people today" print "We have ", passengers, "people to carpool today" print "We need to put about ", average_passengers_per_car, "in each car today"
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