Advertisement
Mars83

2-5

Oct 3rd, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #! /usr/bin/env python3.2
  2. # -*- coding: utf-8 -*-
  3.  
  4. # main.py
  5. """ Task: Exercise 2.5
  6.    Write a program which prompts the user for a Celsius temperature, convert
  7.    the temperature to Fahrenheit and print out the converted temperature.
  8. """
  9.  
  10. # Main
  11. celsius = float(input("Celsius: "))
  12. fahrenheit = round(((( celsius * 9 ) / 5 ) + 32), 1)
  13. print(str(celsius) + " °C are equal to " + str(fahrenheit) + " °F.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement