网球锦标赛数据读取脚本泛化性问题及样本结果验证
The script spoon.py, which determines the "wooden spoon" loser of a tennis tournament, currently has a generalization issue—it doesn't correctly handle all tournament data cases. Below are test samples to illustrate the problem:
Test Sample 1: file_1.txt
file_1.txt
A. Aardvark d. C. Capybara
C. Capybara d. B. Badger
C. Capybara d. F. Flamingo
A. Aardvark d. G. Goat
F. Flamingo d. Bye
E. Echidna d. D. Dolphin
A. Aardvark d. E. Echidna
Execution & Expected Output
When running the script against this file:
python spoon.py file_1.txt
The expected output is:
No one wins the wooden spoon.
Test Sample 2: file_2.txt
file_2.txt
C. Capybara d. A. Aardvark
C. Capybara d. B. Badger
C. Capybara d. F. Flamingo
A. Aardvark d. G. Goat
F. Flamingo d. Bye
E. Echidna d. D. Dolphin
A. Aardvark d. E. Echidna
The script fails to generalize to cases like this second sample, meaning it won't produce the correct result even though the tournament structure follows similar rules to the first sample.
内容的提问来源于stack exchange,提问作者Nauman Shahid

