Skip to content

Instantly share code, notes, and snippets.

@FGFW
Created May 1, 2016 20:14
Show Gist options
  • Select an option

  • Save FGFW/adb9ebc6b66bac1c1bb4d7b4d9d4f012 to your computer and use it in GitHub Desktop.

Select an option

Save FGFW/adb9ebc6b66bac1c1bb4d7b4d9d4f012 to your computer and use it in GitHub Desktop.
python3找出字符数最多的行
"""
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