Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- Created on Tue Feb 20 20:40:22 2018
- @author: EduardoP
- """
- def fahrenheit(celcius):
- f = celcius * 9/5 +32
- return f
- def kelvin(celcius):
- k=celcius+273.15
- return k
- def rankine(celcius):
- r=(celcius+273.15)*9/15
- return r
- def temperatures():
- for celcius in range(-30,70,10):
- print ('When the temperature is', celcius, ' celcius in Rankine the temperature is:',rankine(celcius),'In Kelvin it is:', kelvin(celcius),'In fahrenheit it is:', fahrenheit(celcius))
- if (celcius>60 and celcius<-30):
- print('sorry cant compute these values, try between 60 and -30')
- def celcius(c):
- print('In farenheit the temperature is',fahrenheit(c))
- if c>30:
- print('wow its hot! Find an AC!')
- if c<-30:
- print('omg its freezing! Find shelter!')
- if -10<=c<=10:
- print ('Are you back in dublin?')
- if c>10:
- print ('put on some shorts!')
- if c<-10:
- print ('put on a coat!')
- def main():
- c=float(input('what is the temperature in celcius?'))
- temperature=celcius(c)
- print(temperature)
- #print(temperatures())
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement