mirea-projects/First term/Algorithms/4/2.py
2024-09-24 02:22:33 +03:00

16 lines
328 B
Python
Executable File

def main(string: str) -> None:
some_dict = {}
for char in string:
if some_dict.get(char) is None:
some_dict[char] = 1
continue
some_dict[char] += 1
for key in some_dict.keys():
print(f"'{key}': {some_dict[key]}")
if __name__ == "__main__":
main("hello world")