Question #102357

Write a program that asks the user for a number. If the number is between 1 and 255, the program outputs the corresponding ASCII character. If it is outside of that range, the program outputs Out of range.

Expert's answer

i = int(input("Enter a number: "))
if i >= 1 and i <= 255:
    print(chr(i))
else:
    print("Out of range")
LATEST TUTORIALS
APPROVED BY CLIENTS