Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I figured the first function pretty well but it is getting tough at the second function HELP ME PLS Homework Task 4_201903.pdf 1/1 numbers in
I figured the first function pretty well but it is getting tough at the second function
HELP ME PLS
Homework Task 4_201903.pdf 1/1 numbers in a row, column or diagonal on their card. The player will then call, "Bingo!" 70 x 45 x x and the host will examine their card and award them the win. The numbers on the 7 | 22| 20 | | card range from 1 to 75. The center square on the grid is considered automatically crossed off. Write two functions: A function called generate_grid that returns a 5x5 list where each position is a random number between 1 and 75 and the center square (5 marks) marked with an 'X'. A function called grid_wins that takes a parameter called grid. It should return True if all positions in one row, column or diagonal contain only 'X's. (5 marks) Write a program to: Generate a grid using the generate_grid function. Loop the following until the grid_wins function returns True: (1 mark) (1 mark) 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. 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) (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,] [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,1 [22,13,x,69,6,] [74,22,31,61,3,1 [64,44,47,48,53,] Your program should end if all numbers in a column, row or diagonal become 'X', such as: [,, , 35,60,] [, , 36,,,] [,, , ,, 1 174,,31,,, ] [,, ,48,,]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started