3.1.2 
list1 = ['physics', 'chemistry', 1997, 2000]
list2 = [1, 2, 3, 4, 5 ]
list3 = ["a", "b", "c", "d"]
3.1.3
list1 = ['physics', 'chemistry', 1997, 2000]
list2 = [1, 2, 3, 4, 5, 6, 7 ]

print "list1[0]: ", list1[0]
print "list2[1:5]: ", list2[1:5]
list1[0]:  physics
list2[1:5]:  [2, 3, 4, 5]
3.1.4
list = []          ## 空列表
list.append('Google')   ## 使用 append() 添加元素
list.append('Runoob')
print list
3.1.5
list1 = ['physics', 'chemistry', 1997, 2000]

print list1
del list1[2]
print "After deleting value at index 2 : "
print list1
3.1.6
>>>L = ['春天', '花开', '诗酒']
>>> L[2]
'诗酒'
>>> L[-2]
'花开'
>>> L[1:]
['Runoob', 'Taobao']
3.2.2
tup1 = ('physics', 'chemistry', 1997, 2000)
tup2 = (1, 2, 3, 4, 5 )
tup3 = "a", "b", "c", "d"
tup = ()
tup = (50,)
3.2.3
tup1 = ('physics', 'chemistry', 1997, 2000)
tup2 = (1, 2, 3, 4, 5, 6, 7 )

print "tup1[0]: ", tup1[0]
print "tup2[1:5]: ", tup2[1:5]
3.2.4
tup1 = (12, 34.56)
tup2 = ('abc', 'xyz')
tup3 = tup1 + tup2
print tup3
3.2.5   tup = ('physics', 'chemistry', 1997, 2000) 
del tup p
3.2.7  L = ('spam', 'Spam', 'SPAM!')
3.2.8 print 'hello', -5.35e93, 18+6.6j, 'world'
a, b = 3, 4
print "Value of a , b : ", a,b
3.3.2  H1 = {"apple", "banana", "cherry"}
print(H1)
H1 = set(("apple", "banana", "cherry")) # 请留意这个双括号
print(H1)
3.3.3  H1 = {"apple", "banana", "cherry"}

for a in H1:
  print(a)

print("banana" in H1)
3.3.4 H1 = {"apple", "banana", "cherry"}
H1.add("orange")
H1.update(["cucumber", "mango", "grapes"])
print(H1)
H1 = {"apple", "banana", "cherry"}
H1. discard ("orange")
print(H1)
H1 = {"apple", "banana", "cherry"}
H1. pop()
print(H1)
H1 = {"apple", "banana", "cherry"}
H1. clear()
print(H1)
H1 = {"apple", "banana", "cherry"}
del H1
3.3.5 set1 = {"a", "b" , "c"}
set2 = {1, 2, 3}

set3 = set1.union(set2)
print(set3)
set1 = {"a", "b" , "c"}
set2 = {1, 2, 3}

set1.update(set2)
print(set1)
3.4.2 >>> dict = {'a': 1, 'b': 2, 'b': '3'}
>>> dict['b']
'3'
>>> dict
{'a': 1, 'b': '3'}
>>>dict = {'Alice': '2341', 'Beth': '9102', 'Cecil': '3258'}
>>>dict1 = { 'abc': 456 }
>>>dict2 = { 'abc': 123, 98.6: 37 }

3.4.3 >>>dict = {'Book': 'Java', 'Score': 90, 'No.': '0001'}

>>>print "dict[' Book']: ", dict[' Book']
>>>print "dict['Score']: ", dict['Score']

3.4.4 >>>dict = {'Book': 'Java', 'Score': 90, 'No.': '0001'}

>>> dict['Score'] = 79 # 更新
>>> dict['Book'] = "C++" # 添加


>>>print "dict['Score']: ", dict['Score']
>>>print "dict['Book']: ", dict['Book']
>>>dict = {'Book': 'Java', 'Score': 90, 'No.': '0001'}

>>> del dict['Name']  # 删除键是'Name'的条目
>>> dict.clear()      # 清空字典所有条目
>>> del dict          # 删除字典
>>>dict = {'Name': 'Zara', 'Age': 7, 'Name': 'Manni'} 

>>>print "dict['Name']: ", dict['Name']






