Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON - A chess board has 64 squares. How many grains of rice did the man receive? How muchrice is that what does it weigh?

PYTHON - A chess board has 64 squares. How many grains of rice did the man receive? How muchrice is that what does it weigh? Give some reasonable comparison that makes sense.Assume a single grain of rice weighs 25 mg, and that rice weighs about 577 kilograms percubic meter. The State of Alabama has a total area of 135,765 sq. km. Write a Python program that calculates the total number of grains of rice the man was paid,how much it weighed, and how deep the pile would be if spread evenly over all of Alabama.(For simplicitys sake, we will assume the surface of the entire state is flat, and that the ricecan be spread in one, even layer.) The answer is 5887.0279900 meters deep( 5.887 km).

My output for depth was 5887027900281.343, which is wrong. Can someone fix my code? Thanksimage text in transcribed

# Initialize the variables to find the total amount of rice rice = 1 total = 0 for i in range (1,65): total += rice print("The amount of rice on square", i, "is: ", rice) print('Total amount of rice the wise man was paid:', total) rice rice2 10 12 13 14 15 16 17 18 19 20 21 # Find the weight of rice WTmg-total *25 # Convert rice weight in mg to rice weight in kg WTkg = WTmg/1000 # The unit for density is kg/m^3 density = 577 print("The weight of the rice in kilograms was", WTkg) # The formula for volume is mass / density print ("The total volume in cubic meters was", (WTmg/density)) # Total area of Alabama in m^2 area - # Total area of Alabama in m^3 total area = area/1000 # Depth = Volume/ total-area print ("The depth is", (WTkg/density)/total area) 23 2 4 25 26 27 2 8 135765

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago