Output For the candidate sudoku in the file, your program should simply print: True if the sudoku is valid (i. each digit is used once in each 3x3...
This question has been answered
Question

In python, using procedural abstraction. This is for a first year computer science course so please keep it simple. Docstring and/or an explanation of how you got the answer would be really appreciated

question 1 part 1.png

quest 1 part 2.png

Image transcriptions

A sudoku is a popular puzzle that involves using the digits from 1 to 9 in various ways. For this assignment. we will consider only what we call a simplified sudoku. A simplified sudoku consists of an N x N grid, where N is always a multiple of 3. Each 3x3 block of the grid forms its own area. For example, on a 9x9 grid, there will be 9 such areas: AP 7 8 1 8 7 2 1 3 W U W N 7 8 8 1 3 un W A W N CO U 9 A simplified sudoku is valid if and only if each area contains all of the digits from 1 to 9 exactly once (real sudokus have constraints on the rows and columns as well, but we'll ignore those here). The example above is a valid simplified sudoku. In this question you will implement a program that checks whether an N x N square of numbers is a valid simplified sudoku or not. Input The data for your program will come from a datafile that describes a single sudoku puzzle that may or may not be valid. You can 'hardcode' the name of the data file in your program. To test on different data files. just change the file name in your program. The file will consist of the following lines: . A number N on a line by itself. This will be the size of the sudoku. You may assume that N is greater than O and is always a multiple of 3. . N lines of N of integers, separated by spaces A sample input file might look like this: W N W 1 W N You will be provided with several input files on the class Moodle. You can test your program with these. We will also test your program with some input files that we are NOT giving you.

Output For the candidate sudoku in the file, your program should simply print: . True if the sudoku is valid (i.e. each digit is used once in each 3x3 area) . False otherwise What to Hand In . Your implementation of the program: alq1 . py. Be sure to include your name. NSID, student number, course number and laboratory section at the top of all documents. Evaluation . 4 marks: Your program reads the datafiles correctly . 8 marks: Your validity check is well implemented and can handle sudokus of varying size . 4 marks: Your program produces the correct output for each test file . 4 marks: Documentation. You have made an appropriate effort to document your code.

Answered by Expert Tutors

usce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ip

lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitu
Step-by-step explanation

a. Fusce dui lectus, congue vel la

cing elit. Nam laci

icitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lect

o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lac

sum dolor sit amet, consectetur adipiscing

cing elit. Nam laci

or nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molest

or nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac

ultrices ac magna. Fusce dui l


, ultrices ac magna. Fusce dui lectus, congue vel

cing elit. Nam laci

cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a m

cing elit. Nam laci

Fusce dui lectus, congue vel laore

facilisis. Pellentesque dapibus efficitu

ia pulvinar tortor nec facilisis. Pellentesque dapibus

sum dolor sit amet, consectetur adipiscin

ia pulvinar tortor nec facilisis. Pellentesque dapibus

molestie consequat, ultrices ac magna. Fu

ia pulvinar tortor nec facilisis. Pellentesque dapibus

ce dui lectus, congue vel laoreet ac


m risus ante,

, dictum vitae

ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lao

, dictum vitae

, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit

ur laoreet. Nam risus ante, dapibus a molestie consequat, u

o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipi

acinia pulvinar tortor nec facilisis. Pellentesque da

sum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitu

entesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, d

cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus a

, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor s

sque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectu

ur laoreet. Nam risus ante, dapibus a molestie

ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet

ur laoreet. Nam risus ante, dapibus a molestie

fficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue

nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictu

at, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus eff

nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui le

ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam


ec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, cons

usce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacin

ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque

inia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, d

sque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna.

facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce

gue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing eli

dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia

ec aliquet. Lorem ipsum dolor sit amet, con

The student who asked this found it Helpful
Overall rating 100%
Get unstuck

376,503 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses