Answers for "dictionary in python code"

5

dictionary in python

dict = {"apple": "fruit", "ball": "object", "cricket": "sports"}

#how to print?

print(dict["cricket"])
Posted by: Guest on January-11-2022
1

dictionary in python

myDict = {
    "Fast": "In a Quick Manner",
    "Hasya": "A Coder",
    "Marks": [1, 2, 5],
    "anotherdict": {'hasya': 'Player'}
}

# print(myDict['Fast'])
# print(myDict['Hasya'])
myDict['Marks'] = [45, 78]
print(myDict['Marks'])
print(myDict['anotherdict']['hasya'])
Posted by: Guest on January-12-2022
1

dictionary in python

shapes={"square": 90, "triangle": 60}
Posted by: Guest on November-11-2020

Code answers related to "dictionary in python code"

Python Answers by Framework

Browse Popular Code Answers by Language