Python: Science: Calculating Energy

less than 1 minute read

The code has been modified slightly and now uploaded to the site.

The questions are from the C++ Textbook.

Question

<— Return Home

28.py (should’ve been 210.py, naming mistake)

m = float(input("Enter the amount of water in kilograms: "))
initial_temp = float(input("Enter the initial temperature: "))
final_temp = float(input("Enter the final temperature: "))
q = m * (final_temp - initial_temp) * 4184 
print("The energy needed is " + str(q))

<— Return Home