(Mar-29-2020, 05:18 AM)glennford49 Wrote: i cant get the desired output... And you fail to tell us what you get instead of the desired output. That makes it more difficult for us to see what goes wrong.
When you get output you do not understand you had best add print statements to your code to see step by step what is really happening. You may add print statements to show the value of num, list1 and list2 just before or after you change them.
(Hint: concentrate on list1.)