Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you solving via python pls ! THX a lot!!! Homework Task 4_201903.pdf 1/1 BOVENBOUNCVCONCURSOS PURO P ORODIGO numbers in a row, column or diagonal

Can you solving via python pls !

THX a lot!!!image text in transcribed

Homework Task 4_201903.pdf 1/1 BOVENBOUNCVCONCURSOS PURO P ORODIGO numbers in a row, column or diagonal on their card. The player will then call, "Bingo!" x 70 x 45 x and the host will examine their card and award them the win. The numbers on the x x x x card range from 1 to 75. The center square on the grid is considered automatically crossed off. X X X 22 x 20 X X X X Write two functions: A function called generate_grid that returns a 5x5 list where each position is a random (5 marks) number between 1 and 75 and the center square is marked with an 'X'. A function called grid_wins that takes a parameter called grid. It should return True (5 marks) if all positions in one row, column or diagonal contain only 'X's. Write a program to: Generate a grid using the generate_grid function. Loop the following until the grid_wins function returns True: o Generate a random number between 1 and 75 and print it. If the grid contains that number, replace that number with an 'X'. Print the grid with one row per line. o Check if the grid has crossed off a row, column or diagonal using the grid_wins function and print "Bingo!" if the function returns True. (1 mark) (1 mark) (1 mark) (4 marks) (2 marks) (1 mark) Ensure you include: A comment containing the academic integrity statement found on the Moodle. Comments throughout your code to explain important sections. Hint: Your initial bingo card should contain random numbers and may look like the following: (73, 70, 16, 35, 60,] [17,7, 36, 69,2,1 [22,13,X, 69,6,1 [74, 22, 31, 61,3,) [64, 44, 47, 48, 53,] Throughout the program you should generate a random number and cross off that number if it was found, such as: Number was 73 [X, 70, 16, 35, 60,] [17,7, 36, 69,2, [22,13,X, 69,6,1 (74, 22, 31, 61,3,] [64, 44, 47, 48,53,1 Your program should end if all numbers in a column, row or diagonal become 'X', such as: [X, X, X, 35, 60,1 [X,X, 36,X,X, ) [X, X, X, X,X, ) (74,X, 31, X, X, ) [X, X, X, 48,X, )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago