Using Python 70 Write Program Determine First Turn Red Ball Drawn Bag See Fig 365 Figure 3 Q37020157

Using Python:

<The file coloredBalls.txt contains the sequence in whichcolored balls were drawn out of a bag. The file is available on thecompanion website. Use the file in Exercises 70.>

70. Write a program to determine the first turn in which a redball was drawn from the bag. See Fig. 3.65.

Figure 3.65.) A red ball was first drawn in turn 2.

ColoredBalls.txt

Blue

White

Red

Black

White

Blue

Red

Black

Black

Red

Red

Blue

White

Red

Blue

Black

White

White

Red

Blue

White

Red

Black

White

Blue

Red

Black

Black

Red

Red

Blue

White

Red

Blue

Black

White

White

Red


Solution


Thanks for the question, here is the code in python, pleasego through the comments to understand what each line of code isdoing

let me know in case you have any question or face anyproblem

==========================================================================

# function takes in filename and color to

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.