0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Pyhon、len()と、randint()について

Last updated at Posted at 2020-04-05

len()とrandint()についてメモ。
#(1)len()
リスト型を引数にすると、その要素を取得できる。

.py
list = [0,1,2,3,4,5]
print(len(list))

#6が出力される

#(2)randint()
乱数を発生させる。

.py
import random
r = random.randint(1,100)
print(r)

#1から100までのうちの乱数を生成
0
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
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?