Question

Write a python program to do the following: A. How many total grains of wheat did...

Write a python program to do the following: A. How many total grains of wheat did the ruler have to pay the inventor? B. A wheat grain weighs about 50mg. How much did the wheat weigh in tons (a ton is 1000 kilos)? C. If 1kilogram of wheat costs $5. How much would that wheat cost nowadays? (convert the number to billions of dollars and separate the output with commas between each thousand –for example a sample output should look like $ 5,123,4323,234 billion. D. Which is more? All the gold on earth or the wheat gift?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import locale
locale.setlocale( locale.LC_ALL, '' )

TotalGrainsWheat = int(input("How many total grains did the ruler to pay the investor? Please Enter: "))
WheatInKg=(TotalGrainsWheat*50)/1000000 #calculating wheigh in kilograms
WheatInTon=WheatInKg/1000 # calculating weight in tons
print(" ")
print("Total Wheat Weight in terms of tons = ",WheatInTon,"tons")
print(" ")
print("1 kilogram of wheat cost $5")#considering wheat cost $5
cost = WheatInKg * 5
print("Total Wheat cost nowadays is ",locale.currency(cost,grouping=True),"billion")#converting into number to currency
print(" ")
print("Which is more? All the gold on earth or the wheat gift?")#wheat can be regrown easily in less time but gold takes time to create
print("Wheat gift is on earth")

import locale locale.setlocale locale.LC ALL, ) File Edit Shell DebugOptions Windows Python 3.4.0 (v3.4.0:041714765c13, Mar

Add a comment
Know the answer?
Add Answer to:
Write a python program to do the following: A. How many total grains of wheat did...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT