Case2. An integer number K is given. Output a line-description of the estimate corresponding to the number K (1 is "bad", 2 is "unsatisfactory", 3 is "satisfactory", 4 is "good", 5 is "excellent"). If K does not lie in the range 1-5, then output the line "error".

Solution in Python 3:

K = str(input("Enter the number from the range 1-5: "))
ocenka = {
'1': 'bad',
'2': 'unsatisfactory',
'3': 'satisfactory',
'4': 'good',
'5': 'excellent'
}
try:
print(ocenka[K])
except KeyError as e:
print('error')