Untitled

Anonymous
python
09/18/2023 9:24 AM
388 B
18
Indexable
test = "100x44y2a"
string_to_build = ""
int_mult = ""
for i in range(len(test)):
    if test[i].isdigit():
        int_mult = int_mult + test[i]
    else:
        string_to_build = string_to_build + (int(int_mult) * str(test[i]))
        int_mult = ""

print(string_to_build)

Editor is loading...