Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

https://gist.github.com/ZWHEELER93/e50ce5217aceb601684af92664fea983 Hi can someone help me with this code? ^^^

In case you can't open the Gist, Here are the instructions:

CS1400: Rainwater Storage Tank Calculator

Rainwater can be collected and stored for later use in many situations. Some people do this at their homes and use the water for washing cars, watering gardens, etc. Wildlife management personal and ranchers do it to provide more water for the wildlife and livestock.

The catchment systems usually consist of 1) a catchment area, a rectangular area that slopes downhill, 2) a tank to store the water that runs off of the catchment area.

It’s important to have a tank large enough to capture the water from big storms, but not so big that it never fills up.

You will make a program that helps water conservationists calculate the size they want for their catchment tank.

Assignment

Write a program that asks the user for the width and length of their catchment area, and the amount of rain that falls in big storms in their area. Then, the program will calculate the number of gallons of rain that may be captured in such a storm, and suggest the size of tank the user should use.

There are about 7.48 gallons per cubic foot. There are 12 inches per foot.

Here is what I have so far:

Def main(): PrintDirections() inchesOfRain= float( input("How many inches of rainfall in a large storm?")) Width=float(input("45") Length=(input("20") FeetOfRain=inchesOfRain/12.0 cubicFeet=(width*length*FeetofRain) Gallons=("280.5") Print main()

I have the majority coded, but I keep getting syntax errors. Anyone tell me what i'm missing?

Thanks!

2 Answers

Hi Zachary,

I've re-written your program a bit, and left the calculations part to you because: A) I'm using the metric system B) it's 6:30 am :-)

Let me know if you have any questions.

Kindly, Idan.

inches_of_rain = float(input("How many inches of rainfall in a large storm? "))
width = float(input("How wide is your catchment area? "))
length = float(input("How long is your catchment area? "))

tank = 'enter your calculation here'
print('Yhe size of your tank should be: {}'.format(tank))

Thanks! Big help Zach