I have list1 of a certain length and list2 of a certain length. Let's say:
list1 = [32, 345, 76, 54]
list2 = [43, 65, 76, 23, 12, 23, 44]
I need to make list1 loop back around until it is the same length as list2. Or, if list1 is longer, I need it to cut down to the length of list2. For the example above, I am looking to make:
list1 = [32, 345, 76, 54, 32, 345, 76]
It doesn't necessarily have to remain list1. It can be a new list I just need the same values from list1 looped back around a certain number of times. How do I go about doing this? I'm fairly new to python and I haven't been able to find anything that works.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)