Guest User

Untitled

a guest
Nov 23rd, 2019
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x = []
  2. while True:
  3.     a = input('Введите латинское слово: ')
  4.     if a == '':
  5.         break
  6.     else:    
  7.         if a.isalpha():
  8.             if a[-3:] == 'ere' or a[-2:] in ['re', 'ri'] or a[-1] == 'i':
  9.                 x.append(a)
  10.  
  11. with open('words.txt', 'w', encoding='utf-8') as f:
  12.     for s in x:
  13.         f.write(s + '\n')
RAW Paste Data