What’s wrong with this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What’s wrong with this code?

Basically, Newarray contains a list of numbers, array contains a list of text. I want this function to print the test from indexes given by newarray. It’s currently retuning only the first letter in the first word. def joining(newarray, array):     hello = 0     start = 1     for number in newarray:         print(''.join(array[hello:start]))         hello = start         start = + 1         return Thank you

26th Oct 2018, 5:58 PM
Irene
Irene - avatar
1 Answer
0
it still doesn’t print the whole string, is there something wrong with the loop?
28th Oct 2018, 1:10 PM
Irene
Irene - avatar