I got an file with text form:
a:
b(0.1),
c(0.33),
d:
e(0.21),
f(0.41),
g(0.5),
k(0.8),
h:
y(0.9),
And I want get the following form:
a: b(0.1), c(0.33)
d: e(0.21), f(0.41), g(0.5), k(0.8)
h: y(0.9)
In python language, I have tried:
for line in menu:
for i in line:
if i == ":":
but i do not know if i wondering print (text before i and after i till meet another i) as one line.
also delete the ',' at end of the line