1

I need to have an input where the user writes the temperature in either celsius or fahrenheit, and it will convert it to the opposite one. I cant figure out why it's not working (there is no output at all)

this is my code: (forgive me for bad naming)

the_print = input ("Insert the temperature you would like to convert:")
the_slice = the_print [-1 : :]
the_number = the_print [ : -1 ]
if the_slice == "f" or the_slice == "F" :
    print = (float(the_number) - 32) / 1.8
elif the_slice == "c" or the_slice == "C" :
    print = (float(the_number) *1.8 + 32)
matt mayz
  • 11
  • 2
  • Please add a tag to your question that show which programming language you are trying! In most languages you should remove the `=` that you have placed right after `print`, because `print` might be a `function` and not a `variable`. – Markus Aug 09 '22 at 14:30

0 Answers0