Last active
September 28, 2021 15:09
-
-
Save bennett39/380441c8699376cd988a20897ba95801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
def lambda_handler(event, context): | |
""" Build a random cold-cut sandwich """ | |
meats = [ | |
'ham', 'salami', 'turkey', 'chicken', 'meatball', 'tempeh' | |
] | |
cheeses = [ | |
'cheddar', 'provolone', 'swiss', 'american', 'gruyere' | |
] | |
toppings = [ | |
'lettuce', 'tomato', 'pickles', 'onions', 'peppers' | |
] | |
selected_meat = event.get('meat', random.choice(meats)) | |
selected_cheese = event.get('cheese', random.choice(cheeses)) | |
selected_topping = event.get('topping', random.choice(toppings)) | |
sandwich = f'{selected_meat} & {selected_cheese} with {selected_topping}' | |
return { | |
'statusCode': 200, | |
'body': json.dumps(sandwich) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment