python中的"如果不是"是什么?
例如,第三行是什么意思?
选择 | 换行 | 行号
- contents = open("file.dat").read()
- for line in contents.split("*"):
- if not line: continue # Remove initial empty string.
- line = line.strip() # Remove whitespace from beginning/end of lines.
- items = line.split("-")
- print items[0], ":", " ".join(items[1:])