parent
eb2cb5f0fc
commit
645c3eed00
|
@ -11,18 +11,18 @@ def main():
|
||||||
names = ['关羽', '张飞', '赵云', '马超', '黄忠']
|
names = ['关羽', '张飞', '赵云', '马超', '黄忠']
|
||||||
subjs = ['语文', '数学', '英语']
|
subjs = ['语文', '数学', '英语']
|
||||||
scores = [[0] * 3] * 5
|
scores = [[0] * 3] * 5
|
||||||
for row, name in enumerate(names):
|
# for row, name in enumerate(names):
|
||||||
print('请输入%s的成绩' % name)
|
# print('请输入%s的成绩' % name)
|
||||||
for col, subj in enumerate(subjs):
|
# for col, subj in enumerate(subjs):
|
||||||
scores[row][col] = float(input(subj + ': '))
|
# scores[row][col] = float(input(subj + ': '))
|
||||||
print(scores)
|
# print(scores)
|
||||||
# for row, name in enumerate(names):
|
for row, name in enumerate(names):
|
||||||
# print('请输入%s的成绩' % name)
|
print('请输入%s的成绩' % name)
|
||||||
# scores[row] = [None] * len(subjs)
|
scores[row] = [None] * len(subjs)
|
||||||
# for col, subj in enumerate(subjs):
|
for col, subj in enumerate(subjs):
|
||||||
# score = float(input(subj + ': '))
|
score = float(input(subj + ': '))
|
||||||
# scores[row][col] = score
|
scores[row][col] = score
|
||||||
# print(scores)
|
print(scores)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue