Created
May 1, 2016 20:14
-
-
Save FGFW/adb9ebc6b66bac1c1bb4d7b4d9d4f012 to your computer and use it in GitHub Desktop.
python3找出字符数最多的行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| python3找出字符数最多的行 | |
| http://bbs.bathome.net/thread-1249-1-1.html | |
| 2016年5月2日 03:56:13 codegay | |
| """ | |
| with open("a.txt") as f: | |
| kv={''.join(r.split()).__len__():r for r in f} | |
| print(kv[max(kv)]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment