【发布时间】:2013-12-25 11:50:19
【问题描述】:
如果我有两种方法:
- 一种是将
string更改为tuple并返回它的方法。 - 其他方法打印出返回的
tuple。
最后我该怎么做?
输入类似于"12345 firstName lastName otherInfo"。
def information(sentence):
splitUp = sentence.split(' ')
return sentence
def printAsString():
"".join(sentence)
print(sentence)
【问题讨论】:
-
您能提供输入和预期输出吗?
-
您是否尝试将参数传递给
printAsString?你的information函数已经接受了一个参数,所以你知道它是如何工作的。