Help us understand the problem. What is going on with this article?

【初心者】Pythonの配列

Pythonで配列を使ってみる

split()に何も指定しないと、空白で区切ってリストを作ってくれる。

>>> s1 = "The quick brown fox jumps over the lazy dog."
>>> s_list = s1.split()
>>> print(s_list)
['The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog.']
>>> print(s_list[1])
quick
>>> len(s_list)
9
>>> while i < len(s_list):
    print(s_list[i])
    i += 1


The
quick
brown
fox
jumps
over
the
lazy
dog

>>> for w in s_list:
    print(w)


The
quick
brown
fox
jumps
over
the
lazy
dog.
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away