- 1
if string[i] is equal to 0, why multiplies with (i+1)?
string = input() i = 0 while (i < len(string)): print(string[i] * (i+1)) i += 1
2 Antworten
+ 1
It depends on what you want to output.
If string is cat, you will print:
c
aa
ttt
+ 1
string[i] never equal to 0.
print( "Test this " * 3 )