str.splitを使ってみる (Python)
Python
Published: 2021-04-25

確認環境

$ python --version
Python 3.6.2 :: Anaconda custom (64-bit)

調査

test.py

n = input().split()
print(n)
print(type(n))
print("---")
a = "a b c"
b = a.split()
print(b)
print(type(b))

出力結果

$ python test.py
1 2 3
['1', '2', '3']
<class 'list'>
---
['a', 'b', 'c']
<class 'list'>

参考