Write a Python program that can convert an integer between 0 and 15 into hexnumber (including 0 and 15). The user enters an inte
ger from the console,and the program displays the corresponding hex number. If the user enters an integer out of range, the program displays a warning message about the invalid input.
print(str(number) + " in hexadecimal is: " + str(hex(number)))
else:
print("Invalid input!")
Explanation:
Ask the user to enter an integer and set it to the number
Check if the number is between 0 and 15. If it is, then convert the number into hexadecimal number using hex method and print it. Otherwise, print a warning message.