Advertisement
endzie_fyrge

[15] Water Temperature

Jul 9th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. print("Volume unit is cubic decimetre or litre and the temperature unit is degrees celsius.")
  2.  
  3. volume_one = int(input("Enter the volume of existing water: "))
  4. temperature_one = int(input("Enter the temperature of existing water: "))
  5. volume_two = int(input("Enter the volume of added water: "))
  6. temperature_two = int(input("Enter the temperature of added water: "))
  7.  
  8. mass_one = volume_one * 1000
  9. mass_two = volume_two * 1000
  10.  
  11. T = (mass_one * temperature_one + mass_two * temperature_two) / (mass_one + mass_two)
  12.  
  13. print(f"The temperature of mixed water is {T} degrees.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement