Advertisement
Josif_tepe

Untitled

Oct 19th, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. import math
  2.  
  3.  
  4. def e_samoglaska(c):
  5.     return c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u'
  6. def main():
  7.     a = input("Vnesi prv string: ")
  8.     b = input("Vnesi vtor string: ")
  9.  
  10.     samoglaski = 0
  11.     soglaski = 0
  12.  
  13.     for c in a:
  14.         if e_samoglaska(c):
  15.             samoglaski += 1
  16.         else:
  17.             soglaski += 1
  18.  
  19.     for c in b:
  20.         if e_samoglaska(c):
  21.             samoglaski += 1
  22.         else:
  23.             soglaski += 1
  24.  
  25.     print(f"Samoglaski = {samoglaski}")
  26.     print(f"Soglaski = {soglaski}")
  27.  
  28.  
  29.  
  30. if __name__ == "__main__":
  31.     main()
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement