<jupyter_start><jupyter_text>Day 8 challenge: DictionariesPlease click on the link to view the challenge on hackerank website: https://www.hackerrank.com/challenges/30-dictionaries-and-maps/problem<jupyter_code># N susequent lines
n = int(input())

#create empty phonebook
phonebook = {}

#In name variable goes names and in id variable goes phone numbers
for i in range(0,n):
    name, id = input().split()
    phonebook[name] = id
    

while (1):
    # if the name string is empty, while loop will break
    string = ''
    name = input()
    if (name == string):
        break
    # if name appears in keys of a phonebook, then name and number is printed
    if(name in phonebook.keys()):
        print (name + "=" + phonebook[name])
    else:
        print ("Not found")<jupyter_output>2
Alex 98765400
Sawani 98765432
Alex
Alex=98765400
Murphy
Not found
sawani
Not found
Alex
Alex=98765400<jupyter_text>What I learned?Dictionaries-  Dictionaries in python starts and ends with {}, which has key value pairs-  No constraients on size-  Access by key instead of index-  key can have one data type and values other data type<jupyter_code>#Defining dictionary
name = {'Sawani': 490, 'Clare': 500, 'Alex':650}
#Additing more key-value pairs to dictionary
name['Jack'] = 444
name['Savi'] = 689
print(name)
#delete the item in dictionary
del name['Savi']
print(name)
#convert dictionary keys to list
list(name.keys())
#Convert dictionary values to list
list(name.values())
#Sort all the keys
sorted(name.keys())
#Converting sequence of key value pairs into dictionaries
dict([('bread', 12), ('butter', 21)])
#Dict comprehensions can be used to create a dictionary
{a: a**3 for a in (1,2,3)}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10593713620488941, 'fraction_numerical': 0.03550640279394645, 'mean_word_length': 4.40566037735849, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '375501', 'license': 'MIT', 'n_tokens_mistral': 591, 'n_tokens_neox': 541, 'n_words': 208, 'path': 'Day-8-challenge.ipynb', 'repo_name': 'sawani02/30-Days-Of-Code-Python', 'size': '1718'}