Advertisement
Blessing988

Untitled

Feb 20th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. def split_in_two(values, number):  #two parameters
  2.     if number%2==0:
  3.         print(values[2: ])
  4.     else:
  5.         print(values[0 : 2])
  6.  
  7.  
  8.  
  9. split_in_two(["Book", "bag", "pencil", "pen"], 1)  # Example( it must contain two arguments) the first argument must be a list containing strings and the second argument must be a positive integer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement