Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. def SimpleSymbols(s):
  2.   for i in xrange(len(s)):
  3.     if i > 0:
  4.         # If we aren't at the first position, there are valid positions before us
  5.         prev_c = s[i - 1]
  6.     else:
  7.         prev_c = None
  8.  
  9.     curr_c = s[i]
  10.  
  11.     if i < len(s) - 1:
  12.         # If we aren't at the last position, there are valid positions after us
  13.         next_c = s[i + 1]
  14.     else:
  15.         next_c = None
  16.  
  17.     # Now what?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement