-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
775486c
commit 65eefdb
Showing
1 changed file
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
# Default Imports | ||
from greyatomlib.python_getting_started.q01_read_data.build import read_data | ||
data = read_data() | ||
import yaml | ||
|
||
def read_data(): | ||
f=open('./data/ipl_match.yaml') | ||
datadict=yaml.load(f) | ||
return datadict | ||
|
||
def bowled_out(datadict): | ||
bowled_players=[] | ||
deliveries=datadict['innings'][1]['2nd innings']['deliveries'] | ||
for delivery in deliveries: | ||
for key, value in delivery.items(): | ||
if 'wicket' in value.keys(): | ||
if value['wicket']['kind']=='bowled': | ||
bowled_players.append(value['wicket']['player_out']) | ||
return bowled_players | ||
|
||
datadict=read_data() | ||
bowled_out(datadict) | ||
|
||
|
||
# Your Solution | ||
def bowled_out(data=data): | ||
|
||
# Write your code here | ||
|
||
|
||
return bowled_players |