I want to convert an input from Celsius to Fahrenheit but I don’t understand how to accept negative and decimal inputs while also eliminating the non digit inputs like ‘abc’.
`temp = input('enter a temperature in C: ')
if temp.isdigit():
temp = int(temp)
print(f'{temp * 1.8 + 32} F')
else:
print('not a temp')`
New contributor
Shani Shaharabani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.