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)
program p1;
uses crt;
const N = 30;
var a:array[1..N] of integer;
i,b,k:integer;
begin
for i:=1 to N do begin Вывод рандомных элементов
a[i]:=random(50);
write(a[i]:4);
end;
writeln;
readln(b);
for i:=1 to N do begin
if b<>a[i] then begin ( если b не равно эл массива то
k:=k+1; (счётчик)
write(a[i]:4); (вывод))
writeln(k);
end.
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)
program p1;
uses crt;
const N = 30;
var a:array[1..N] of integer;
i,b,k:integer;
begin
for i:=1 to N do begin Вывод рандомных элементов
a[i]:=random(50);
write(a[i]:4);
end;
writeln;
readln(b);
for i:=1 to N do begin
if b<>a[i] then begin ( если b не равно эл массива то
k:=k+1; (счётчик)
write(a[i]:4); (вывод))
end;
end;
writeln;
writeln(k);
end.