【发布时间】:2012-08-03 17:14:24
【问题描述】:
my_string = """This is my first line,
this is my second line, and...
...this is my fourth line!"""
如何将第一行 (This is my first line,) 存储到单独的字符串中?我试图从另一个类似的问题中使用.readline(),但是我收到了这个错误:
AttributeError: 'str' object has no attribute 'readline'
【问题讨论】:
-
这根本不是重复的。