Calculate Total Litres Required To Fill Carpark Using Python3
I have to work out how many liters of concrete can fit into a park. Len park: 30.2m | wid of the park: 10m | liters per sq/m: 6.6. I have attempted this and am new to python and know how to calculate the total. (30.2 * 10 * 6.6 = total). But I'm struggling to print the result.
length = 30.2 width = 10 squared = 6.6 length = int(input('Length of park (m):')) width = int(input('Width of park (m):')) squared = int(input('Litres per square metre:')) sum = length * width * squared # calculate total metres to get answer print("Litres Required =",sum) # print total amount of liters required
"30.2" is a float since it has a decimal point, not an
sum is a keyword in python, so avoid using it as a variable name.
Try it online! (note, since this is a website, the output is different than you running it normally)
length = float(input('Length of park (m):')) width = float(input('Width of park (m):')) squared = float(input('Litres per square metre:')) total = length * width * squared # calculate total metres to get answer print("Litres Required =",total) # print total amount of liters required
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Django, code inside <script> tag doesn't work in a template
- → React - Django webpack config with dynamic 'output'
- → GAE Python app - Does URL matter for SEO?
- → Put a Rendered Django Template in Json along with some other items
- → session disappears when request is sent from fetch
- → Python Shopify API output formatted datetime string in django template
- → Shopify app: adding a new shipping address via webhook
- → Shopify + Python library: how to create new shipping address
- → shopify python api: how do add new assets to published theme?
- → Access 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT' with Python Shopify Module