Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. def even(n):
  2. return n % 2 == 0
  3.  
  4. def solution(s):
  5. n = len(s)
  6. m = n // 2
  7. if even(n):
  8. return s[m-1:m+1]
  9. else:
  10. return s[m]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement