2
3

More than 1 year has passed since last update.

配列の要素数、配列の要素の表示、文字列分割

Posted at

Python3で配列の要素数、配列の要素の表示、文字列分割のプログラムを実装しました

    str = "Hello paiza"
    #スペース区切りの文字列を分割する
    array1 = str.split(' ')
    #配列の要素数を取得する
    num = len(array1)
    #ループ文で表示する
    for i in range(num):
        print(array1[i])

split関数で文字列を分割して配列に格納します。
len関数を使って配列の要素数を取得します
for文で配列の要素順に表示します。

2
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3