<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Dictionaries
A dictionary is datatype that contains a series of key-value pairs. It is similar to a list except for that the indices of the values can be strings, tuples, etc. not just integers. It is also different in that it is unordered. You cannot expect to get the keys in the same order out as you put them in.
To create a dictionary
Step1:  To access a value, you index into it similarly to a list using square brackets.
value_of_key1 = my_dict['key1']
Step2:  Trying to access a key not in the dictionary throws an error
Step3:  To add an item to the dictionary set the value equal to the indexed keys
dict['new_key'] = value
Step4:  To delete a key, use the del keyword
del dict['key to delete']
Step5:  Rules on keys
Keys in dictionary must be unique. If you try to make a duplicate key, the data will be overwritten
Keys must be hashable. What this means is they must come from immutable values and be comparable. You can use strings, numbers, tuples, sets, (most) objects. You cannot use lists or dictionaries as keys.
Step6:  TRY IT
Create a dictionary called vegetable_season with Eggplant-> July and Onion -> May
Step7:  Dictionary Operators
The in operator returns a boolean for whether the key is in the dictionary or not.
key in dictionary
Step8:  You can use this in if statement
Step9:  TRY IT
Check if 'broccoli' is in vegetable_season. If so, print 'Yum, little trees!'
Step10:  Dictionaries and Loops
You can use a for in loop to loop through dictionaries
for key in dictionary
Step11:  Dictionary Methods
You can use the keys, values, or items methods to return lists of keys, values, or key-value tuples respectively.
You can then use these for sorting or for looping
Step12:  TRY IT
Loop through the sorted keys of the vegetable_season dictionary. For each key, print the month it is in season
Step13:  More complex dictionaries
Dictionary keys and values can be almost anything. The keys must be hashable which means it cannot change. That means that lists and dictionaries cannot be keys (but strings, tuples, and integers can).
Values can be just about anything, though.
Step14:  Let's use this to create a more realistic fruit season dictionary
Step15:  TRY IT
Add a key to the true_fruit_season for 'watermelons' the season is July, August, and September
Project
Step16:  Bonus Material
Auto generating the dictionary for the acrostic
<ASSISTANT_TASK:>
Python Code:
fruit_season = {
    'raspberry': 'May',
    'apple'    : 'September',
    'peach'    : 'July',
    'grape'    : 'August'
} 
print(type(fruit_season))
print(fruit_season)
Explanation: Dictionaries
A dictionary is datatype that contains a series of key-value pairs. It is similar to a list except for that the indices of the values can be strings, tuples, etc. not just integers. It is also different in that it is unordered. You cannot expect to get the keys in the same order out as you put them in.
To create a dictionary:
my_dict = { key1: value1, key2: value2 }
Creating an empty dictionary
my_dict = {} 
my_dict = dict()
End of explanation
raspberry_season = fruit_season['raspberry']
print(raspberry_season)
Explanation: To access a value, you index into it similarly to a list using square brackets.
value_of_key1 = my_dict['key1']
End of explanation
print(fruit_season['mangos'])
Explanation: Trying to access a key not in the dictionary throws an error
End of explanation
fruit_season['strawberry'] = 'May'
print(fruit_season)
fruit_season['strawberry']
Explanation: To add an item to the dictionary set the value equal to the indexed keys
dict['new_key'] = value
End of explanation
del fruit_season['strawberry']
print(fruit_season)
Explanation: To delete a key, use the del keyword
del dict['key to delete']
End of explanation
duplicate_fruit_season = {
    'raspberry': 'May',
    'raspberry': 'June',
} 
print(duplicate_fruit_season)
mutable_key = {
    ['watermelon', 'cantaloupe', 'honeydew']: 'July'
}
# The solution is to use a tuple instead
immutable_key = {
    ('watermelon', 'cantelope', 'honeydew'): 'July'
}
Explanation: Rules on keys
Keys in dictionary must be unique. If you try to make a duplicate key, the data will be overwritten
Keys must be hashable. What this means is they must come from immutable values and be comparable. You can use strings, numbers, tuples, sets, (most) objects. You cannot use lists or dictionaries as keys.
End of explanation
vegetable_season = {
    'Eggplant': 'July',
    'Onion': 'May'
}
print(vegetable_season)
Explanation: TRY IT
Create a dictionary called vegetable_season with Eggplant-> July and Onion -> May
End of explanation
print('raspberry' in fruit_season)
print('mangos' in fruit_season)
Explanation: Dictionary Operators
The in operator returns a boolean for whether the key is in the dictionary or not.
key in dictionary
End of explanation
if 'pineapple' in fruit_season:
    print('Lets eat tropical fruit')
else:
    print("Temperate fruit it is.")
Explanation: You can use this in if statement
End of explanation
if 'broccoli' in vegetable_season:
    print('Yum, little trees!')
else:
    print('No little trees.')
Explanation: TRY IT
Check if 'broccoli' is in vegetable_season. If so, print 'Yum, little trees!'
End of explanation
for fruit in fruit_season:
    print ("{0} is best in {1} (at least in Virginia)".format(fruit.title(), fruit_season[fruit]))
Explanation: Dictionaries and Loops
You can use a for in loop to loop through dictionaries
for key in dictionary:
    print key
End of explanation
print(fruit_season.keys())
print(fruit_season.values())
print(fruit_season.items())
for key, value in fruit_season.items():
    print ("In {0} eat a {1}".format(value, key))
print (sorted(fruit_season.keys()))
Explanation: Dictionary Methods
You can use the keys, values, or items methods to return lists of keys, values, or key-value tuples respectively.
You can then use these for sorting or for looping
End of explanation
for fruit in sorted(fruit_season.keys()):
    print('In {0} {1} is in season.'.format(fruit_season[fruit], fruit))
Explanation: TRY IT
Loop through the sorted keys of the vegetable_season dictionary. For each key, print the month it is in season
End of explanation
my_complicated_dictionary = {
    (1, 2, 3): 6,
    'weevil': {
        'e': 2,
        'i': 1,
        'l': 1,
        'v': 1,
        'w': 1,
    },
    9: [3, 3]
}
print (my_complicated_dictionary)
Explanation: More complex dictionaries
Dictionary keys and values can be almost anything. The keys must be hashable which means it cannot change. That means that lists and dictionaries cannot be keys (but strings, tuples, and integers can).
Values can be just about anything, though.
End of explanation
true_fruit_season = {
    'raspberry': ['May', 'June'],
    'apple': ['September', 'October', 'November', 'December'],
    'peach': ['July', 'August'],
    'grape': ['August', 'September', 'October']
} 
print (true_fruit_season)
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
for month in months:
    print ('It is {0}'.format(month))
    for fruit, season in true_fruit_season.items():
        if month in season:
            print ("\tEat {0}".format(fruit))
Explanation: Let's use this to create a more realistic fruit season dictionary
End of explanation
from random import randint #necessary for "challenge"
# step 1: create dictionary with one adjective per letter of the alphabet
myadjectives = {
    'A':['admirable','aggressive','agile','agitated','agonizing','agreeable'],
    'B':'biodegradable',
    'C':['cloudy','creative'],
    'D':'deserted',
    'E':'everlasting',
    'F':'flamboyant',
    'G':'grotesque',
    'H':'humming',
    'I':'imperfect',
    'J':'joyful',
    'K':'kosher',
    'L':'lively',
    'M':'modest',
    'N':'nervous',
    'O':'ornate',
    'P':'playful',
    'Q':'quick',
    'R':['restless','relieved','remarkable','remorseful', 'remote'],
    'S':'strong',
    'T':'tiny',
    'U':'ugly',
    'V':'vital',
    'W':['wobbly','well-made'],
    'X':'oops!',
    'Y':'youthful',
    'Z':'zesty'
}
type(myadjectives['C'])
# step 2: create funtion acrostic, takes name as an argument
def acrostic (name):
    # step 3: capitalize name
    capName = name.upper()
    
    # step 4
    for letter in capName:
        current_adj_list = myadjectives[letter]
        if type(current_adj_list) == list:
            current_adj = current_adj_list[randint(0,len(current_adj_list)-1)]
        else:
            current_adj = current_adj_list
        print("{0} - {1}".format(letter, current_adj))
        
acrostic('Lilly')
Explanation: TRY IT
Add a key to the true_fruit_season for 'watermelons' the season is July, August, and September
Project: Acrostic
Create an acrostic poem generator.
You will create a function that takes a name and generates an acrostic poem
Create a dictionary that has each of the capital letters as keys and an adjective that start with the letter as the value and store in variable named adjectives. (Reference: http://www.enchantedlearning.com/wordlist/adjectives.shtml)
Create a function called "acrostic", which takes one parameter "name" as argument.
In the acrostic function capitalize the name (use the upper method)
For each letter in the name
Get the adjective corresponding to that letter (from our dictionary) and store it in a variable called current_adj
Print out Letter-current_adj
 Challenge  instead of just one adjective have each letter's value be a list of adjectives. Use the random module to select a random adjective instead of always selecting the same one.
End of explanation
# If you have a list of adjectives
my_dict = {}
# Imaging this is the full alphabet
for i in ['A', 'B', 'C']:
    my_dict[i] = []
    
    
for i in ['Adoreable', 'Acceptable', 'Bad', 'Cute', 'Basic', 'Dumb','Active']:
    first_char = i[0]
    if first_char in my_dict:
        my_dict[first_char].append(i)
print (my_dict)
# Generating from a file
my_dict = {}
for i in ['A', 'B', 'C']:
    my_dict[i] = []
    
# adjectives.txt has one adjective per line
with open('adjectives.txt') as fh:
    for line in fh:
        word = line.rstrip().title()
        first_char = word[0]
        if first_char in my_dict:
            my_dict[first_char].append(word)
            
print (my_dict['A'])
Explanation: Bonus Material
Auto generating the dictionary for the acrostic:
End of explanation
<END_TASK>