Exam Scores
Captain Holt has corrected the exam papers of detectives and noted the scores of the written and physical tests. The results were posted in two lists: one with the scores of the written test, the other with the scores of the physical test in order of the badge numbers. The office needs a list containing the detective's scores on both tests in order of their badge number.
Input
First line of input contains the score of students in Chemistry exam separated by comma. Second line of input contains the score of students in English exam separated by comma.
Output
Every line of output contains the score obtained by each student in English and Chemistry exams separated by space
Explanation
Given the input
Written Test 65
Minysical Test - 25
That is, Detectivel scored 75 in Physical Test and 65 in
Written Test.
The output should be 76 65
Sample Input 1
65
75
Sample Output 1
75 65
writtenTest = input().split(' ')
physicalTest = input().split(' ')
status = True
if len(writtenTest) == len(physicalTest):
for num in writtenTest:
if not num.isdigit():
status = False
for num in physicalTest:
if not num.isdigit():
status = False
else:
status = False
print('The number of marks on tests is different')
if status:
print('Written/Physical')
for i in range(len(writtenTest)):
print(f"{writtenTest[i]}\t{physicalTest[i]}")
else:
print('The input must contain only numbers separated by spaces.')
Comments
Leave a comment