Menu

Figured First Function Pretty Well Getting Tough Second Function Help Pls Q43834756

I figured the first function pretty well but it is getting toughat 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 4

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 5×5 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,х,] Show transcribed image text 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 5×5 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,х,]

Expert Answer


Answer to I figured the first function pretty well but it is getting tough at the second function HELP ME PLS…

OR