Did you know you can optionally use one-based indexing in Python? Source: twitter.com

Just use the "-1" flag. For example:

 >>> a[n] = x      # zero-based indexing

 >>> a[n -1] = x  # one-based indexing

Site Comments (0)

Please Signin or Signup to add a comment