s= list(map(int,input().split(" ")))
- input() 接收用户输入的数据,数据为字符串格式。
- str.split(” ") 把字符串以某中特定的格式分开,这里是用空格划分。
- map():这里就是把从键盘上获得的数据全都转化成Int型
map(function, iterable, …)
function – 函数
iterable – 一个或多个序列 - list():把map格式的数据存放到listl里面。
s= list(map(int,input().split(" ")))