0
Insert method from two lists of ints and strs
I have a list of strings (K) and list of numbers (V), and I need to insert a string from K into a new list just on the place from V. For example: K = [âpâ, ânâ, âyâ, âhâ, âoâ, âtâ] V = [1, 6, 2, 4, 5, 3] #receive [âpâ, âyâ, âtâ, âhâ, âoâ, ânâ] and then use .join() method. line = [] for i, j in V, K: line.insert (V, K) #probably (int(V), K)? Line = ââ.join(line) Why this doesnât work and says me that there are too many values to unpack? How do I change it? Thank you!
1 RĂ©ponse
0
Forgot to mention: I have managed to do it through a dictionary, though still would be happy to understand, what is my mistake in this piece of code...