-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP3.9.py
31 lines (25 loc) · 1009 Bytes
/
P3.9.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
## Reads a temperature value and the letter C for Celsius or F for Fahrenheit.
## And convert them
# Take the input
print ('Do you use Farenheit (F) or Celcius? (C)')
print ()
degreeUnit=(input('Enter F or C : ')).upper()
temp=int(input('What the temperature of the water?'))
altitude=int(input('Enter a altitude to find the boiling point: '))
# Set the condition if input is F in line with temperature
if degreeUnit =='F' and temp<=32:
print ('The water is frozen.')
elif degreeUnit=='F' and temp>=212:
print ('The water is a gas')
elif degreeUnit=='F' and temp>=33 or temp<=212:
print ('The water is a liquid.')
# Set the condition if input is C in line with temperature
elif degreeUnit=='C' and temp <=0:
print ('The water is frozen.')
elif degreeUnit=='C' and temp>=100:
print ('The water is a gas.')
elif degreeUnit =='C' and temp>=1 or temp<=99:
print ('The water is a liquid.')
else:
print ('Please try again, something went wrong.')