this function shifts the position of an existing list or string and returns it as a new list
(list, num)
| 2 | |
| 3 | |
| 4 | def shift(list, num): |
| 5 | """ |
| 6 | this function shifts the position of an existing list or string and returns it as a new list |
| 7 | """ |
| 8 | list = [x for x in list] |
| 9 | for i in range(num): |
| 10 | first = list[0] |
| 11 | list.pop(0) |
| 12 | list.append(first) |
| 13 | |
| 14 | return list |
| 15 | |
| 16 | |
| 17 | def cipher(string, key): |