兩個字符串沒有做到換行
s = 'Python was started in 1989 by \"Guido\".\n','Python is free and easy to learn.'
print s
為什么這個語句的輸出形式是這個
('Python was started in 1989 by "Guido".\n', 'Python is free and easy to learn.')
我的想法是輸出兩個字符串,第一個字符串打印之后用\n換行,不知道為什么卻做不了
s = 'Python was started in 1989 by \"Guido\".\n','Python is free and easy to learn.'
print s
為什么這個語句的輸出形式是這個
('Python was started in 1989 by "Guido".\n', 'Python is free and easy to learn.')
我的想法是輸出兩個字符串,第一個字符串打印之后用\n換行,不知道為什么卻做不了
2016-07-04
舉報
2016-10-05
直接把這兩句放在一個單引號里面就行了啊
2016-07-04
s = 'Python was started in 1989 by \"Guido\",\n,''Python is free and easy to learn.'
print s
這樣可以換行,不知道你在\n后面加一個逗號是什么意思。逗號不要再外面。
2016-07-04
哦哦,自己看出來了,這是變量輸出,不是直接print輸出