0

[PYTHON DATA STRUCTURES] I dont understand how can i store the index of the text in a variable and theN multiply it with each le

String Operations Let's test your coding skills! Take a string as input and output each letter of the string on a new line, repeated N times, where N is the position of the letter in the string. Sample Input: data Sample Output: d aa ttt aaaa

29th Dec 2021, 7:51 AM
Aniket Singh
Aniket Singh - avatar
2 Antworten
+ 2
Please don't put everything in the heading – it gets cut off and nobody can read it. You could use a for loop to iterate of the string and use a helper variable to count or use enumerate or use a range based on the string length
29th Dec 2021, 8:31 AM
Lisa
Lisa - avatar
0
Found a simple solution myself thanks for the help and sorry for that I'll make sure next time
29th Dec 2021, 8:41 AM
Aniket Singh
Aniket Singh - avatar