Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import factorial
- word = word_out = ' ' + input() + ' '
- for i in set(word.split()):
- len_i = len(i)
- TF = False
- if len_i == 1:
- TF = True
- elif len_i % 2 == 0:
- for j in range(10000):
- factorial_j = factorial(j)
- if factorial_j > len_i:
- break
- elif factorial_j == len_i:
- TF = True
- break
- if TF:
- word_out = word_out.replace(f' {i} ', ' ')
- print(word_out[1:-1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement