How to read two inputs separated by space in a single line?

前端 未结 11 542
天涯浪人
天涯浪人 2020-12-23 22:23

I want to read two input values. First value should be an integer and the second value should be a float.

I saw Read two variables in a single line with Python, but

11条回答
  •  情歌与酒
    2020-12-23 23:01

    If you wish to take as many inputs as u want then following:

        x=list(map(str,input().split())) 
        print(x)
    

    If you want two inputs:

       x,y=x,y=list(map(str,input().split()))
       print(x,y)
    

提交回复
热议问题