Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nums = []
- for i in range(10, 100):
- first_list = [int(a) for a in str(i)]
- second_list = [int(b) for b in str(i * 3)]
- first_sum = sum(first_list)
- second_sum = sum(second_list)
- if first_sum == second_sum:
- nums.append(i)
- length = len(nums)
- print("Існує", length, "двозначних чисел, сума цифр яких не змінюється при множенні числа на 3. Ці числа:" , str(nums)[1:-1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement