I'm extremely new to coding so please bear with me.
I'm currently trying to make a temperature converter and I'm stuck on figuring out how to get an if function to detect if a specific variable is missing an input, essentially I want to be able to leave it empty and if it is empty I would like it to move on to the next stage of the if function.
Below is what I tried doing to figure this out but completely misunderstood what none is meant for
if fahrenheit_input!=None:
print(celcius_answer)
elif celcius_input!=None:
print(fahrenheit_answer)
elif fahrenheit_input==None:
print('No Input')
elif celcius_input==None:
print('No Input')
The end goal is the mix in the following if functions so that when I run it I'm only given 1 variable
if fahrenheit_input==32:
print(celcius,'degrees celcius')
else:print(celcius_answer)
if celcius_input==0:
print(fahrenheit,'degrees fahrenheit')
else:print(fahrenheit_answer)
and for a little more context I've added the code with notes on what does what
### summary of code ###
fahrenheit=32
fahrenheit_input=
celcius=0
celcius_input=
#above are the constants and human inputs
celcius_ans_1=fahrenheit_input-32
celcius_ans_2=celcius_ans_1*5
celcius_ans_3=celcius_ans_2/9
#above is the equation used to determine the fahrenheit to Celsius conversion
fahrenheit_ans_1=celcius_input*9
fahrenheit_ans_2=fahrenheit_ans_1/5
fahrenheit_ans_3=fahrenheit_ans_2+32
#above is the equation used to determine the Celsius to fahrenheit conversion(at my current level I found this to be much simpler as writing them outright would give the wrong answers)
fahrenheit_answer=fahrenheit_ans_3,'degrees farenheit'
celcius_answer=celcius_ans_3,'degrees celcius'
#up above are the answers that are going to be called
if fahrenheit_input==32:
print(celcius,'degrees celcius')
else:print(celcius_answer)
if celcius_input==0:
print(fahrenheit,'degrees fahrenheit')
else:print(fahrenheit_answer)
#above is the meat and potato to this as since it is meant to determine if the constant values or if the human input answers will be used
if fahrenheit_input!=None:
print(celcius_answer)
elif celcius_input!=None:
print(fahrenheit_answer)
elif fahrenheit_input==None:
print('No Input')
elif celcius_input==None:
print('No Input')
#above is my attempt to allow the human inputs to remain empty