20 lines
477 B
Python
20 lines
477 B
Python
user_int = 0
|
|
|
|
while user_int not in range(32, 126):
|
|
user_int = int(input('Enter integer (32 - 126):\n'))
|
|
|
|
user_float = float(input('Enter float:\n'))
|
|
|
|
user_char = ''
|
|
while len(user_char) != 1:
|
|
user_char = str(input('Enter character:\n'))
|
|
|
|
user_string = str(input('Enter string:\n'))
|
|
results = [user_int, user_float, user_char, user_string]
|
|
|
|
print(*results)
|
|
results.reverse()
|
|
print(*results)
|
|
|
|
print('{0} converted to a character is {1}'.format(user_int, chr(user_int)))
|