Skip to content

Instantly share code, notes, and snippets.

@teionn
Last active September 29, 2020 21:59
Show Gist options
  • Save teionn/45b4b684d20cb912b111148c0e6af830 to your computer and use it in GitHub Desktop.
Save teionn/45b4b684d20cb912b111148c0e6af830 to your computer and use it in GitHub Desktop.
def shiftValue(value, values=[35, 70, 100, 120, 150]):
if value in values:
index = values.index(value)
if not len(values) - 1 == index:
return values[index + 1]
else:
return values[0]
else:
return values[0]
try:
value
except:
value=0
value=shiftValue(value)
print value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment