jackfrued / jackfrued/Python-100-Days
day07 scoretable
Open
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
hello,day07,scoretable.py,运行后5人成绩均为最后一人,或许5人的成绩list都为同一个引用。
将main()改为如下即可,如有更好办法请更新,我会继续学习,谢谢!
def main():
names = ['关羽', '张飞', '赵云', '马超', '黄忠']
subjs = ['语文', '数学', '英语']`
scores = list()
t_scores = [None]*3
for row, name in enumerate(names):
print('请输入%s的成绩' % name)
for col, subj in enumerate(subjs):
t_scores[col] = float(input(subj + ': '))
scores.append(t_scores)
print(scores)
`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scoretable.py and its main() entry point, then run the program with five sets of scores to reproduce the reported result. Check that the collected scores for each person remain distinct rather than all showing the final person's values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100