# Creating a Dictionary
# with Integer Keys
Dictionary = {0: 'Softhunt', 1: '.net', 2: 'By', 3: 'Ranjeet'}
print("
Dictionary with the use of Integer Keys: ")
print(Dictionary)
# Creating a Dictionary
# with Mixed keys
Dictionary = {'Name': 'Ranjeet Kumar Andani', 1: [0, 1, 2, 3, 4, 5]}
print("
Dictionary with the use of Mixed Keys: ")
print(Dictionary)
keys = ['a', 'b', 'c']
values = [1, 2, 3]
def create_dictionary(keys, values):
result = {} # empty dictionary
for key, value in zip(keys, values):
result[key] = value
return result
#create an empty dictionary
my_dictionary = {}
print(my_dictionary)
#to check the data type use the type() function
print(type(my_dictionary))
#output
#{}
#<class 'dict'>
# Creating a Dictionary
# with Integer Keys
Dictionary = {0: 'Softhunt', 1: '.net', 2: 'By', 3: 'Ranjeet'}
print("
Dictionary with the use of Integer Keys: ")
print(Dictionary)
# Creating a Dictionary
# with Mixed keys
Dictionary = {'Name': 'Ranjeet Kumar Andani', 1: [0, 1, 2, 3, 4, 5]}
print("
Dictionary with the use of Mixed Keys: ")
print(Dictionary)
keys = ['a', 'b', 'c']
values = [1, 2, 3]
def create_dictionary(keys, values):
result = {} # empty dictionary
for key, value in zip(keys, values):
result[key] = value
return result
#create an empty dictionary
my_dictionary = {}
print(my_dictionary)
#to check the data type use the type() function
print(type(my_dictionary))
#output
#{}
#<class 'dict'>