Advertisement
plarmi

Untitled

Dec 4th, 2023
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. count = 0
  2.  
  3. for number in range(100, 151):
  4.     digit1 = number % 10
  5.     digit2 = (number // 10) % 10
  6.     digit3 = (number // 100) % 10
  7.     digit4 = (number // 1000) % 10
  8.  
  9.     if digit1 != digit2 and digit1 != digit3 and digit1 != digit4 and digit2 != digit3 and digit2 != digit4 and digit3 != digit4:
  10.         count += 1
  11.  
  12.  
  13. print("Количество чисел с разными цифрами:", count)
  14. print(list(range(100, 151)))
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement