Spocoman

Letters Combinations

Feb 15th, 2022 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. x = ord(input())
  2. y = ord(input())
  3. z = ord(input())
  4. counter = 0
  5. output = ''
  6.  
  7. for i in range(x, y + 1):
  8.     for k in range(x, y + 1):
  9.         for j in range(x, y + 1):
  10.             if i != z and k != z and j != z:
  11.                 output += f"{chr(i)}{chr(k)}{chr(j)} "
  12.                 counter += 1
  13.  
  14. print(output + str(counter))
  15.  
  16.  
  17. Или:
  18.  
  19. x = ord(input())
  20. y = ord(input())
  21. z = ord(input())
  22. counter = 0
  23.  
  24. for i in range(x, y + 1):
  25.     for k in range(x, y + 1):
  26.         for j in range(x, y + 1):
  27.             if i != z and k != z and j != z:
  28.                 print(chr(i) + chr(k) + chr(j), end=' ')
  29.                 counter += 1
  30. print(counter)
  31.  
Add Comment
Please, Sign In to add comment