In season ========= Exercise -------- .. interactive_code_block:: :caption: Find out which vegetables are available at a specified season # SOURCE: https://www.bio-austria.at/d/konsument/saisonkalender/ seasonal_calendar = { # f = fresh, s = stocked, w = winter vegetables, - = not in season # JFMAMJJASOND 'broccoli': '-----fffffww', # Brokkoli 'chinese cabbage': 'ss-----fffww', # Chinakohl 'endive': '------fffffs', # Endivien/Friese 'pea': '-----fff----', # Erbsen 'potatoe': 'sssssfffffss', # Erdäpfel 'cucumber': '-----fff----', # Feldgurken 'fennel': '-----fffff--', # Fenchel 'green bean': '-----ffff---', # Fisolen 'head lettuce': '----ffffff--', # Häuptelsalat 'cauliflower': '----ffffff--', # Karfiol 'carrot': 'wwwssffffsww', # Karotte 'garlic': 'ssssssffssss', # Knoblauch 'cabbage': 'ss---ffffffs', # Kohl 'turnip cabbage': 'w---ffffffww', # Kohlrabi 'brussels sprout': 'ff------ffff', # Kohlsprossen 'pumpkin': 'sss----fffss', # Kürbis 'white cabbage': 'ss--ffffffss', # Kraut 'lollo rosso': '----ffffff--', # Lollo Rosso 'corn': '------fff---', # Mais 'chard': '----sssssss-', # Mangold 'eggplant': '------ffff--', # Melanzani 'bell pepper': '-----fffff--', # Paprika 'tomato': '-----fffff--', # Paradeiser 'parsnip': 'wwws----ffww', # Pastinaken 'leek': 'fwws-fffffff', # Porree 'radicchio': '-------ff---', # Radicchio 'radish': '---fffffff--', # Radieschen 'red beet': 'ssssssffffws', # Rote Rübe 'celery': 'ssssssffffss', # Sellerie 'asparagus': '----fff-----', # Spargel 'spinach': 'wwwffff-fffw', # Spinat 'celery stalk': '-----fffff--', # Stangensellerie 'corn salad': 'ffff----ffff', # Vogerlsalat 'zucchini': '------ffff--', # Zucchini 'onion': 'sssssffffsss' # Zwiebel } month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] # How many vegetables are available in November? month = 11 availabile_vegetables = [] # ... print('In {}, {} varieties of vegetables are available fresh or in stock.'.format(month_names[month - 1], len(availabile_vegetables))) # Which vegetables are available fresh in November? month = 11 availabile_vegetables = [] # ... print('In {}, {} varieties of vegetables are available fresh.'.format(month_names[month - 1], len(availabile_vegetables))) # Which vegetables have a short season max_season_length = 3 availabile_vegetables = [] # ... print('During the year, {} vegetables are available only for a maximum of {} months.'.format(len(availabile_vegetables), max_season_length))