GeorgiLukanov87

Nested Looping

Apr 21st, 2022 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. start = input()
  2. end = input()
  3. without = input()
  4. letter_counter = 0
  5. for x1 in range(ord(start), ord(end) + 1):
  6.     for x2 in range(ord(start), ord(end) + 1):
  7.         for x3 in range(ord(start), ord(end) + 1):
  8.             if chr(x1) != without and chr(x2) != without and chr(x3) != without:
  9.                 letter_counter += 1
  10.                 print(f"{chr(x1)}{chr(x2)}{chr(x3)}", end=" ")
  11. print(letter_counter)
Add Comment
Please, Sign In to add comment