Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def even(n):
- return n % 2 == 0
- def solution(s):
- n = len(s)
- m = n // 2
- if even(n):
- return s[m-1:m+1]
- else:
- return s[m]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement