online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
list1 = ["國文", "數學", "自然"] list2 = [["a", "國文", 100], ["a", "數學", 20], ["a", "自然", 40], ["b", "國文", 30], ["b", "數學", 100], ["c", "自然", 60] ] students = sorted(list(set(i[0] for i in list2))) # students list # 3.9+ ONLY # d = {j: i for i, j in enumerate(list1, 1)} | { # j: i for i, j in enumerate(students)} d1 = {j: i for i, j in enumerate(list1, 1)} # course index d2 = {j: i for i, j in enumerate(students)} # student index d = {**d1, **d2} # {'國文': 1, '數學': 2, '自然': 3, 'a': 0, 'b': 1, 'c': 2} res = [[s] + [None]*len(list1) for s in students] # init list for student, course, score in list2: res[d[student]][d[course]] = score print(res)

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue