Advertisement
VanoHa

Why?

Jun 15th, 2021
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. s = ':$!U< /|pEOsb |o^ @@+Cz*'#мое решение через списки
  2. vowel = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u',]
  3. s1 = list(s)
  4. for j in vowel:
  5.     for i in s1:
  6.         if j == i:
  7.             s1.remove(i)
  8. print(''.join(s1))
  9.  
  10. for i in "aeiouAEIOU":#подсмотренное решение
  11.     s = s.replace(i, "")
  12. print(s)
  13. # результат одинаков, но мое не проходит тесты на codewars, а подсмотренное проходит, почему?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement