Python
Please help me with code for line 4, 11, 13 an on. Please I am
stuck on the problem
Problem Statement: In bowling, the player starts with 10 pins in a row at the far end of a lane. The goal is to knock all the pins down. For this assignment, the number of pins and balls will vary. Given the number of pins N and then the number of balls K to be rolled, followed by K pairs of numbers (one for each ball rolled), determine which pins remain standing after all the balls have been rolled. The balls are numbered from 1 to N for this situation. The subsequent number pairs, one for each K represent the first and last (inclusive) positions of the pins that were knocked down with each roll. Print a sequence of N characters, where "I" represents a pin left standing and "" represents a pin knocked down.
Test # 1 12 Input 10 3 8 10 25 36 52 12 44 10 3 35 46 10 10 50 55 5 5 33 Output I........ |..I.I |||....|||. |||||
bowling.py 1 # Please replace . . . (three dots) with your code. Don't forget the indentation. def update_bowling_configuration (pins, first, last): 2 | 3 '' 'Changes the pins configuration according to the fallen pins from first to last'' 4 n, k = [int (str_numbers) for str_numbers in input().split()] 7 pins = ['I'] *n # All pins are standing at the start of the game 8 for rolls in range(k): 9 first, last = [int(s) for s in input().split()] # collection of strike data #call your function below 10 11 12 #print pins below 13
Python Please help me with code for line 4, 11, 13 an on. Please I am stuck on the problem
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am