Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def nextCell(s):
- l = len(s)
- row = ord(s[l-1:l])-ord('A')
- col = int(s[0:l-1])+1
- if (col > 12):
- col = 1
- row += 1
- if (row > 7):
- row = 0
- row = chr(row + ord('A'))
- return "{0}{1}".format(col,row)
- print("3C => ", nextCell("3C"))
- print("12C => ", nextCell("12C"))
- print("12H => ", nextCell("12H"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement