Page 1 of 1

Write a Python program that meets the following specifications: In bowling, the player starts with 10 pins in a row at t

Posted: Mon Jul 11, 2022 9:57 am
by answerhappygod
Write a Python program that meets the followingspecifications:
In bowling, the player starts with 10 pins in a row at the farend of a lane. The goal is to knock all the pins down. For thisassignment, the number of pins and balls will vary. Given thenumber of pins N and then the number ofballs K to be rolled, followedby K pairs of numbers (one for each ballrolled), determine which pins remain standing after all the ballshave been rolled.
The balls are numbered from 1 to N for thissituation. The subsequent number pairs, one foreach K represent the first and last (inclusive)positions of the pins that were knocked down with each roll. Printa sequence of N characters,where "I" represents a pin left standingand "." represents a pin knocked down.
You must use the code below as a base:def update_bowling_configuration(pins, first, last): '''Changes the pins configuration according to thefallen pins from first to last'''n, k = [int(str_numbers) for str_numbers ininput().split()] pins = ['I'] * n # All pins are standing at the start of thegamefor rolls in range(k): first, last = [int(s) for s in input().split()] #collection of strike data #call your function below #print pins below
Example input:10 3
8 10
2 5
3 6
Example output: I.....I...