Question: using python 3.0 or + I need help finishing writing the code for determining a latin square. A Latin square is a square of N

using python 3.0 or +

I need help finishing writing the code for determining a latin square. A Latin square is a square of N by N, where all the rows, columns have one value of 1 to N exactly.

Here is what I got so far.

## The following code assigns the values of the latin square values from the user input.  latin_sq_order= int(input("Please enter the value of the Latin Square order (N): ")) latin_sqaure_list = [ (x).split(',') for x in input("enter the latin square with spaces in between the numbers: ").split()] def is_latin_sq(list,order): count_1 = 0 count_2 = 0 count_3 = 0 for x in list: for y in x: if int(y) == 1: count_1 += 1 elif int(y) == 2: count_2 += 1 elif int(y) == 3: count_3 += 1 if count_1 and count_2 and count_3 == count_2: print("Is a latin square.",) else: print("Is not a latin square", ) 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!