Guest User

Untitled

a guest
Jan 4th, 2023
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. lst_one = [1, 2, 3, 4]
  2. iterable = 6
  3. lst_two = []
  4.  
  5. while lst_one:
  6.   i = iterable % len(lst_one)
  7.   lst_two.append(lst_one[i])
  8.   del lst_one[i]
  9.   iterable += 1
  10.  
  11. print(lst_one)  # []
  12. print(lst_two)  # [2, 1, 4, 3]
Advertisement
Add Comment
Please, Sign In to add comment