python3.7.2 組み込み関数
組み込み関数
abs() delattr() hash() memoryview() set()
all() dict() help() min() setattr()
any() dir() hex() next() slice()
ascii() divmod() id() object() sorted()
bin() enumerate() input() oct() staticmethod()
bool() eval() int() open() str()
breakpoint() exec() isinstance() ord() sum()
bytearray() filter() issubclass() pow() super()
bytes() float() iter() print() tuple()
callable() format() len() property() type()
chr() frozenset() list() range() vars()
classmethod() getattr() locals() repr() zip()
compile() globals() map() reversed() __import__()
complex() hasattr() max() round()
実行結果
139856767407944 139856767407944 5 1
0x400 0o2000 0b10000000000
True False
(2, 1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
[0, 3, 6, 9, 12, 15, 18]
[True, False, False, True, False, False, True, False, False, True, False, False, True, False, False, True, False, False, True, False]
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361]
[0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5832, 6859]
5207581967981133503
組み込み関数
abs() delattr() hash() memoryview() set()
all() dict() help() min() setattr()
any() dir() hex() next() slice()
ascii() divmod() id() object() sorted()
bin() enumerate() input() oct() staticmethod()
bool() eval() int() open() str()
breakpoint() exec() isinstance() ord() sum()
bytearray() filter() issubclass() pow() super()
bytes() float() iter() print() tuple()
callable() format() len() property() type()
chr() frozenset() list() range() vars()
classmethod() getattr() locals() repr() zip()
compile() globals() map() reversed() __import__()
complex() hasattr() max() round()
#id max min print a=[1,2,3,4,5] b=a print(id(a),id(b),max(a),min(a)) #hex oct bin print(hex(1024),oct(1024),bin(1024)) #any all a=[(1==2),(2==2),(3==2)] print(any(a),all(a)) #divmod a=7 b=3 print(divmod(a, b)) def three(n): return n%3==0 #range filter list a=list(range(20)) print(a) print(list(filter(three, a))) #map pow print(list(map(three,a))) def mul(a,b): return a*b print(list(map(mul,a,a))) print(list(map(pow,a,[3]*len(a)))) #hash print(hash("2019"))
実行結果
139856767407944 139856767407944 5 1
0x400 0o2000 0b10000000000
True False
(2, 1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
[0, 3, 6, 9, 12, 15, 18]
[True, False, False, True, False, False, True, False, False, True, False, False, True, False, False, True, False, False, True, False]
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361]
[0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5832, 6859]
5207581967981133503