Advertisement
vencinachev

Messages

Feb 19th, 2022
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1.  
  2. while True:
  3.     is_end = False
  4.     msg = ''
  5.     occur_c = False
  6.     occur_o = False
  7.     occur_n = False
  8.  
  9.     while occur_c == False or occur_o == False or occur_n == False:
  10.         sym = input()
  11.         if sym == 'End':
  12.             is_end = True
  13.             break
  14.         if sym[0] == 'c' and occur_c == False:
  15.             occur_c = True
  16.             continue
  17.         elif sym[0] == 'o' and occur_o == False:
  18.             occur_o = True
  19.             continue
  20.         elif sym[0] == 'n' and occur_n == False:
  21.             occur_n = True
  22.             continue
  23.        
  24.         if (sym[0] >= 'a' and sym[0] <= 'z') or (sym[0] >= 'A' and sym[0] <= 'Z'):
  25.             msg += sym[0]
  26.            
  27.     if is_end == True:
  28.         break
  29.     print(f'Message: {msg}')
  30.    
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement