Python 實現一行輸入多個數字,用空格隔開

不少人都會使用如下代碼,來實現多個字符串的連續輸入,可是這是以換行進行操做的,而有些題目須要將一些數字進行一行輸入python a=input() b=input() 1.實現一行輸入多個數字,並以空格隔開。翻譯 a,b=map(int,input().split()) print(a,b) print(type(a)) #運行結果 1 2 1 2 <class 'int'> 2.實現一個輸入多
相關文章
相關標籤/搜索