Advertisement
Josif_tepe

Untitled

Oct 19th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import math
  2.  
  3. def main():
  4.     a = input("Prv string: ")
  5.     # b = input("Vtor string: ")
  6.  
  7.     a_mapa = dict()
  8.     b_mapa = dict()
  9.  
  10.     for c in a:
  11.         if c not in a_mapa.keys():
  12.             a_mapa.update({c: 1})
  13.         else:
  14.             a_mapa.update({c: a_mapa.get(c) + 1})
  15.  
  16.  
  17.  
  18.     for key, value in a_mapa.items():
  19.         print(f"Key: {key} = {value}")
  20.  
  21.  
  22.  
  23.  
  24. if __name__ == "__main__":
  25.     main()
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement