Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitaharlalka committed Apr 16, 2018
1 parent 775486c commit 65eefdb
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions q06_bowled_players/build.py
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

0 comments on commit 65eefdb

Please sign in to comment.