Commits

Takayuki KONDO committed 8366e96

#11 リストを扱ってみよう(2)

Comments (0)

Files changed (1)

 # -*- coding:utf-8 -*-
 # リスト
 
-a = [1, 2, "a", 5.5]
-b = list([3,5])
+# sort / reverse
 
-print a
-print b
+a = [1, 5, 2, 10]
 
-# len + * [] [start:end]
-
-print a * 5
-print len(a)
-
-
-print a[2]
-
-a[2] = "b"
+a.sort()
 
 print a
 
-a[2:4] = ['b','c']
+a.reverse()
 
 print a
+
+# in  False or True 
+
+print 3 in a
+print 5 in a
+
+# range
+
+b = range(3, 10, 2)
+print b
+