python dict example
Example 1: how to use dictionaries in python
student_data = {
"name":"inderpaal",
"age":21,
"course":['Bsc', 'Computer Science']
}
print(student_data['name'])
print(student_data['age'])
print(student_data['course'])[0]
Example 2: python dictionary
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict["year"] = 2018
Example 3: what is a dictionary in programming
// This is a JS Object (dictionary eqiv.)
var obj = {
num:16,
str:'hello',
bool:true
};
Example 4: dict python
a = {'a': 123, 'b': 'test'}