Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这行代码..
raw_input("Hello, %s, this is a question: ") % name
但我得到并错误地说:
“并非所有参数都在字符串格式化期间转换”
使用%s时可以使用input()吗?
%s
input()
name在错误的位置;改成:
name
raw_input("Hello, %s, this is a question: " % name)
例如:
>>> name = 'Mary' >>> raw_input('Hello, %s, this is a question:' % name) Hello, Mary, this is a question: