Answer to Question #319480 in Python for Psy

Question #319480

Find The missing number in each row


4


1 2 3 4


2 3 4 1


3 4 1 2


4 1 2 3


If all rows contains 1 to 4 numbers then it is true else false



1
Expert's answer
2022-03-29T07:41:05-0400
n = int(input())
for i in range(n):
	flag = True
	nums = [int(j) for j in input().split()]
	for j in range(n):
		if j+1 not in nums:
			flag = False
			break
	print(flag)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS