last lab
This commit is contained in:
12
labPython/lab5/Slov9.py
Executable file
12
labPython/lab5/Slov9.py
Executable file
@@ -0,0 +1,12 @@
|
||||
string = input()
|
||||
count = {}
|
||||
result = ""
|
||||
|
||||
for char in string:
|
||||
if char not in count:
|
||||
count[char] = 0
|
||||
else:
|
||||
count[char] += 1
|
||||
result += f"{char}_{count[char]}"
|
||||
|
||||
print(result)
|
||||
Reference in New Issue
Block a user