Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import time
- t_start = time()
- start = int(input('Введіть початок діапазону: '))
- end = float(input('Введіть кінець діапазону: '))
- end_int = int(end+1)
- for n in range(start, end_int):
- last_digit = n%10
- print('last =', last_digit, 'n =', n)
- i = 0
- while n > 10:
- first_digit = n = n/10
- i += 1
- print('first =', int(first_digit), 'n =', n)
- if first_digit == last_digit != 0:
- print(n)
- t_finish = time() - t_start
- print('Витрачено', (t_finish*1000), 'мілісекунд')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement