Skip to content

Instantly share code, notes, and snippets.

@isaacarroyov
Created April 5, 2021 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacarroyov/c5ed45ba65a14e4d86c6257f97b2b6f0 to your computer and use it in GitHub Desktop.
Save isaacarroyov/c5ed45ba65a14e4d86c6257f97b2b6f0 to your computer and use it in GitHub Desktop.
#assign colours to duration days
def colour_duration(string):
if string == '1 Día':
return '#003049'
elif string == '2 a 3 Días':
return '#FCBF49'
elif string == '4 a 7 Días':
return '#F77F00'
else:
return '#D62828'
# translate from spanish to english
def translate_days(string):
if string == '1 Día':
return '1 day'
elif string == '2 a 3 Días':
return '2 to 3 days'
elif string == '4 a 7 Días':
return '4 to 7 days'
else:
return 'More than 7 days'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment