How to input the number of input in python

前端 未结 2 1438
被撕碎了的回忆
被撕碎了的回忆 2021-01-26 04:19

I want to input in inline

1. input number : 5  
2. 1 5 3 4 2

how to receive input for the number of inputs in python?

I\'ve been trie

2条回答
  •  北海茫月
    2021-01-26 04:41

    simple

    i = list(map(int, input("Numbers: ").split()))
    print(i)
    

    It will accept multiple integers as input on a single line in Python3

提交回复
热议问题