Advertisement
bl00dt3ars

05. Faro Shuffle

Mar 6th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. data = input().split()
  2. shuffles = int(input())
  3.  
  4. for i in range(shuffles):
  5.     left_half = data[:len(data) // 2]
  6.     right_half = data[len(data) // 2::]
  7.     current_shuffle = []
  8.     for x in range(len(left_half)):
  9.         current_shuffle.append(left_half[x])
  10.         current_shuffle.append(right_half[x])
  11.     data = current_shuffle
  12.  
  13. print(data)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement