Professional Documents
Culture Documents
Assignment 1
Assignment 1
Python data types and an example for each, along with the reasons for using these data
types:
Data field
Identifier Data Type Example Reason
Names may contain letters and
player_name String "Virat Kohli" other characters, making string the
appropriate data type.
Example:-
# Define the data structure for individual player stats
player_stats = [
{
"player_name": "Virat Kohli",
"age": 32,
"country": "India",
"teams": ["Royal Challengers Bangalore", "India"],
"formats": ["Test", "ODI", "T20"],
"batting_average": 53.94,
"bowling_average": None,
"batting_style": "Right-handed",
"bowling_style": "Right-arm medium",
"total_runs": 7240,
"total_wickets": None,
"total_matches": 254,
"highest_score": 254,
"best_bowling_figures": None,
"strike_rate": 93.0,
"economy_rate": None,
},
# Add more players here
]