# sets variables to integers cars = 100 space_in_a_car = 4 drivers = 30 passengers = 90 # A = 100 - 30 # total of cars less drivers cars_not_driven = cars - drivers # B = 30 # cards driven will equal drivers cars_driven = drivers # C = (B = 30) * 4.0 # 4 seats by amount of cars carpool_capacity = cars_driven * space_in_a_car # D = 90 / (B = 30) # passengers avereaged out by the amount of cars driven, which is found by the amount of drivers average_passengers_per_car = passengers / cars_driven print "There are", cars, "cars available." print "There are only", drivers, "drivers available." print "There will be", cars_not_driven, "empty cards today." print "We can transport", carpool_capacity, "people today." print "We have", passengers, "to carpool today." print "We need to put about", average_passengers_per_car, "in each car."
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