Skip to content

Instantly share code, notes, and snippets.

@bergpb
Last active April 16, 2020 00:14
Show Gist options
  • Select an option

  • Save bergpb/f2996f8233454281a3c896538c26a7e6 to your computer and use it in GitHub Desktop.

Select an option

Save bergpb/f2996f8233454281a3c896538c26a7e6 to your computer and use it in GitHub Desktop.
Sum months in python, justpython.
import sys
month = sys.argv[1]
add = sys.argv[1]
def add_month(month, add):
next = month + add
if next >= 13:
return 1 if next-12 == 0 else next-12
return next
# python sun-month.py 2 3
# >>> 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment