I need to write a conventer (Celsius to Kelvin,Kelvin to Celsius...). User write: a - degrees(for example 0), b - for example: Kelvin, c - for example: Celsius.
Exercise: Input Format There are a few input lines. Each line consist of three words. First word indicates starting temperature. Second word indicates starting scale. Third word indicates target scale.
Constraints Possible scales are: {"Kelvin", "Celsius", "Fahrenheit"}. Temperatures are up to 1000 degrees. Whenever initial temperature is below Absolute zero output "NO". Number in the output should maintain precision up to second decimal place.
Output Format For each input line one number that is the calculated temperature (with precision of two decimal places) or word "NO".
This is for hackerank
Error:
Traceback (most recent call last):
File "C:/Users...", line 4, in <module>
a, b, c = input().split()
ValueError: not enough values to unpack (expected 3, got 0)
Code:
while True:
a, b, c = input().split()
if int(a) < 0:
print('NO')
else:
Leave the loop when user stop writing.