Skip to content

Commit c044a93

Browse files
Celcius to Farhenhiet and recognition of absurd temperature
1 parent 6f62481 commit c044a93

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'''
2+
Create a function that takes any string as argument and returns the length of that string.
3+
The lowest possible temperature that physical matter can reach is -273.15 C.
4+
With that in mind, please improve the function by making it print out a message in case a number lower than -273.15 is passed as input when calling the function.
5+
'''
6+
def cel_to_fahr(c):
7+
if c < -273.15:
8+
return "Absurd Temperature Value"
9+
else:
10+
f = float(c) * 9/5 + 32
11+
return f
12+
13+
c = float(input("Enter Temperature in Celcius: "))
14+
print(cel_to_fahr(c))

0 commit comments

Comments
 (0)