組み込み関数 sum() 使い方 int / float = sum( iterable ) 渡したiterableの合計を返します list1 = int1 = sum(list1) print( int1 ) #結果 6 組み込み関数
組み込み関数 zip() 使い方 zip = zip( *iterable ) 複数のiterableを渡すと要素をまとめて返します list1 = tuple1 = ('A','B','C') ... 組み込み関数
組み込み関数 bin() 使い方 str = bin(int) 整数を2進数に変換します先頭には2進数を示す0bが付きます str = bin(7) print(str) #結果 0b111 組み込み関数
組み込み関数 str() 使い方 str = str( obj ) 渡したobjのstr型を返します int1 = 1 str1 = str(int1) print(type(str1),str1) #結果 <class 'str&... 組み込み関数
組み込み関数 hash() 使い方 int =hash(tuple) tupleをハッシュ化して返します tuple1='dopy',777 hash(tuple1) #結果 604267554648750771 組み込み関数
組み込み関数 type() 使い方 type1 = type( obj ) 渡したobjのtypeを返します str1 = 'abc' type1 = type( str1 ) print(type1) #結果 <class ... 組み込み関数
組み込み関数 len() サイズ 使い方 int = len( obj ) objのサイズを返します txt='abc' print(len(txt)) #結果 3 文字列str の文字数を返します list1=] print... 組み込み関数
組み込み関数 bool() 使い方 bool = bool(x) xが「真」の時Trueを返しますxが「偽」もしくは省略されているときはFalseを返します print(bool(True)) #結果 Ture print(bool(False)... 組み込み関数