Advertisement
Blessing988

Untitled

Feb 21st, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. def split_in_two(a_list, number):
  2.     if number%2==0:
  3.         print(a_list[2:])
  4.     else:
  5.         print(a_list[0:2])
  6.  
  7. values = ["a", "b", "c", "d", "e", "f"]
  8.  
  9. split_in_two(values, 5)  #Example (it must contain two arguments: the first argument portraying the list and the second argument being your target number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement