Search This Blog
Available Codings for Programming of C, C++, PYTHON, JAVA and HTML.
Welcome to Coding 4 Programming
- Get link
- X
- Other Apps
Labels
Temperature Convertor | Temperature Calculator | Function | User Friendly | Python
Python Program or Project to Convert Temperature (Temperature Conversion's Calculator) from one Unit to another, through Function, completely user Friendly without any type of Errors.
- Coding for the above Program.
- def temp():
- print("1. Fahrenheit")
- print("2. Celsius")
- print("3. Kelvin")
- c=int(input("Enter Your Choice="))
- if(c>=1 and c<=3):
- return c
- else:
- print("Wrong Input.")
- print("Thankyou for Choosing Coding 4 Programming")
- exit()
- def conv(f, t, n):
- if f==1:
- if t==2:
- return (n - 32) * 5/9
- else:
- return ((n - 32) * 5/9 + 273.15)
- elif f==2:
- if t==1:
- return (n * 9/5) + 32
- else:
- return n + 273.15
- else:
- if t==1:
- return (n - 273.15) * 9/5 + 32
- else:
- return n - 273.15
- print("welcome to Coding 4 Programming")
- print("coding4programming.blogspot.com")
- print("Temperature Conversion")
- print("You want to Convert Temperature from:")
- f=temp()
- print("You want to Convert Temperature to:")
- t=temp()
- n=float(input("Enter Value to Convert="))
- if f == t:
- print("Required Value is",n)
- else:
- m=conv(f, t, n)
- print("Required Value is",m)
- print("Thankyou for Choosing Coding 4 Programming")
- Output of the Temperature Conversion Program.
Temperature Convertor Calculator |
Notes:
- If you have any problem related to this program. Please do comment your Problem or Mail us.
- For illustrating the any concept you can comment by line number.
- Thank you! For more programs do regular visit to Coding 4 Programming.
- Get link
- X
- Other Apps
Labels:
Python
Popular Posts
To Check Prime Number | For Loop | Python
- Get link
- X
- Other Apps
To Check Perfect Number | Function | For Loop | Python
- Get link
- X
- Other Apps
Comments
Post a Comment