Menu

Homework Task 4201903pdf 1 1 Bovenbouncvconcursos Puro P Orodigo Numbers Row Column Diagon Q43835270

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 on their card. The pl

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

Expert Answer


Answer to Homework Task 4_201903.pdf 1/1 BOVENBOUNCVCONCURSOS PURO P ORODIGO numbers in a row, column or diagonal on their card. T…

OR