-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_code.py
More file actions
36 lines (34 loc) · 1.04 KB
/
student_code.py
File metadata and controls
36 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
def main(test_case_number):
if test_case_number == 1:
print('# Text-based test cases')
elif test_case_number == 2:
print('# Text Output')
elif test_case_number == 3:
print('') # Empty string
elif test_case_number == 4:
print('42')
elif test_case_number == 5:
print('') # Empty string
elif test_case_number == 6:
print('# Math-based test cases')
elif test_case_number == 7:
print('# Mathematical Operations')
elif test_case_number == 8:
print('') # Empty string
elif test_case_number == 9:
print('15.0')
elif test_case_number == 10:
print('5.0')
else:
print('Invalid test case number')
if __name__ == "__main__":
# The test case number is passed as a command-line argument
if len(sys.argv) > 1:
try:
test_case_number = int(sys.argv[1])
main(test_case_number)
except ValueError:
print('Invalid input')
else:
print('No test case number provided')