`input()`读入一行,以字符串形式返回。
`input()`返回的字符串类型有一种方法(成员函数)叫`split()`,调用方法和C++一样,直接`input().split()`,返回一个没有空白字符的字符串列表。`.split(str)`可以按照`str`作为分割点。
```python3
>>> input().split()
3 4 5
['3', '4', '5']
```
可以顺序赋值`x,y,z=input().split()`,此时`x,y,z`是三个字符串,需要`x=int(x);y=int(y);z=int(z)`
方便起见我们有一个类叫`map`,`map(_func,list)`可以对`list`中每一个元素`a`做`a=int(a)`返回一个`map`的对象,这个对象可以直接用来赋值。`x,y,z=map(int,input().split())`
```python3
>>> x,y,z=map(int,input().split())
73 23 2
>>> x
73
>>> y
23
>>> z
2
```
如果要一个列表用`map`处理返回列表,则写作`list(map(int,list))`
by Terrible @ 2021-11-30 22:32:06
@[行吟啸九州](/user/163980)
```python
x,y,z=map(int,input().split())
```
by 求学的企鹅 @ 2021-11-30 22:33:08
@[Terrible](/user/195942)
不胜感激
by 行吟啸九州 @ 2021-12-01 11:01:15