Basic List Operations
>>> >>> len([1,2,3]) 3 >>> [1,2,3]+[4,5,6] [1, 2, 3, 4, 5, 6] >>> ["hello! "]*3 ['hello! ', 'hello! ', 'hello! '] >>> 3 in [1,2,3] True >>> max([1,2,3,4]) 4 >>> min([1,2,3]) 1 >>> list((1,2,3)) #converts a tuple into list [1, 2, 3] >>> for x in [10,20,30]: print(x) 10 20 30 >>>
コメント
コメントを投稿