#!/usr/bin/python #coding=utf-8 __author__ = 'moxiaokai' #經過參數傳遞,判斷數字、字符串、list、tuple、詞典等數據類型是否爲可變數據對象 a = 2 b = '啊哈' c = [1, 2, 3] d = (1, 2, 3) e = {'tom': 11, 'sam': 57, 'lily': 100} def num(x): #數字 x = 100 print x num(a) print a def str(x): #字符串 x = 'ade' print x str(b) print b def list(x): #list x[0] = 100 print x list(c) print c def tuple(x): #tuple x[0] = 100 print x tuple(d) raise StopIteration() print d def dic(x): #詞典 x['tom'] = 100 print x dic(e) print e