Skip to main content

/docs/images/banner.jpg

Python

Cricket dictionary

Develop a Python program that creates a dictionary to store information about a cricket player, such as name, runs scored. Display the information stored in the dictionary

player = {
'name': 'Sachin Tendulkar',
'runs': 18426,
}

print('Name:', player['name'])
print('Runs:', player['runs'])
# Output:
# {'name': 'Sachin Tendulkar', 'runs': 18426}
note

To compile and run the program, you can use the following commands:

python3 foo.py