Write a program that asks the user for a number. If it is between 1 and 255, output the corresponding ASCII character. If it is outside of that range, output "Out of range"
Sample Run
Enter a number between 1 and 255: 97
a
Enter a number between 1 and 255: 256
Out of range
1
Expert's answer
2019-11-05T07:41:56-0500
while True:
char = int(input("Enter a number between 1 and 255: "))
if 1 <= char <= 255:
x = chr(char)
print(x)
break
else:
print("Out of range")
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment