使用pylint的:
sucmac:~ ajung$ /tmp/bin/pylint ou.py
No config file found, using default configuration
************* Module ou
W: 3,0: Bad indentation. Found 3 spaces, expected 4
W: 5,0: Bad indentation. Found 3 spaces, expected 4
C: 1,0: Missing docstring
C: 1,0: Invalid name "n" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 1,3: Invalid name "dollar" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 1,11: Invalid name "euro" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
W: 1,18: Used builtin function 'map'
W: 1,22: Used builtin function 'input'
E: 3,9: Undefined variable 'dolar'
寫一個測試套件。 –
此外,您呼叫'map'錯誤和不必要的:'N,美元,歐元= input.split()' – chepner
Downvoters:這是一個合理的問題。正因爲存在這樣的情況'dolar'旨在正確並不意味着它是不是有用的提醒你注意它的工具角落的情況。 – chepner