Created
December 8, 2015 05:56
-
-
Save liuderchi/87aca7d5a57dc66ef035 to your computer and use it in GitHub Desktop.
wk3-q3
This file contains hidden or 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
record = '''12.0 TOR Defensive Rebound by Terrence Ross | |
12.0 93-102 LAL D'Angelo Russell missed 3-pt. Jump Shot | |
25.0 93-102 TOR Cory Joseph made 2nd of 2 Free Throws | |
25.0 93-101 TOR Cory Joseph missed 1st of 2 Free Throws | |
25.0 LAL Personal foul on Kobe Bryant | |
39.0 93-101 LAL Kobe Bryant made 2nd of 2 Free Throws | |
39.0 92-101 LAL Kobe Bryant made 1st of 2 Free Throws | |
39.0 TOR Shooting foul on Bismack Biyombo | |
43.0 LAL Full Timeout | |
43.0 91-101 TOR Cory Joseph made 2nd of 2 Free Throws | |
43.0 91-100 TOR Cory Joseph made 1st of 2 Free Throws | |
43.0 LAL Shooting foul on Lou Williams | |
1:01 91-99 LAL Lou Williams made 3-pt. Jump Shot, Assist Jordan Clarkson ''' | |
def count_shot(record): | |
result = 0 | |
# Enter code Here | |
pos = 0 | |
while pos != -1: | |
pos = record.find('Kobe Bryant made', pos + 1 ) | |
if pos != -1: | |
result = result + 1 | |
return result | |
print count_shot(record) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment