def reverse_order_of_number(x):
if len(str(x)) == 5:
test_list = []
new_test_list = test_list
for a in str(x):
test_list.append(a)
print('Before: {}'.format(test_list))
i = 0
while i < 2:
i += 1
p = test_list.pop()
new_test_list.insert(0, p)
print("After: {}".format(new_test_list))
else:
print('The number is not five-digit!')
numbers = int(input("Enter a five-digit number: "))
reverse_order_of_number(numbers)
reverse_order_of_number(54321)
reverse_order_of_number(543)
def reverse_order_of_number(x):
if len(str(x)) == 5:
test_list = []
new_test_list = test_list
for a in str(x):
test_list.append(a)
print('Before: {}'.format(test_list))
i = 0
while i < 2:
i += 1
p = test_list.pop()
new_test_list.insert(0, p)
print("After: {}".format(new_test_list))
else:
print('The number is not five-digit!')
numbers = int(input("Enter a five-digit number: "))
reverse_order_of_number(numbers)
reverse_order_of_number(54321)
reverse_order_of_number(543)