,如果你實現它這樣我熟悉的分裂()函數是如何工作的:Python的輸入()函數
def sayHello():
name = input("whats you´re name?:")
print("hello", name)
在這種情況下,輸入功能,只希望從用戶的一個輸入。 但在這種情況下究竟發生了什麼?
def test():
str1, str2 = input().split()
print(str1, str2)
語法:
a, b = input()
這是一種方式,要求2個輸入用戶在同一時間,或當你會用嗎?
這是[參考](https://docs.python.org/3/reference/simple_stmts.html#assignment-statements)中描述的賦值的特例('如果目標列表是逗號分隔的目標列表......「),通常稱爲[解包](https://en.wikibooks.org/wiki/Python_Programming/Tuples#Packing_and_Unpacking)。 – bereal