摘要: def logger(msg): def log_message(): print('Log:', msg) return log_message # 返回的是函数log_hi = logger('Hi!') # 此时`log_h... 阅读全文
posted @ 2017-06-19 22:49 2021年的顺遂平安君 阅读(42) 评论(0) 推荐(0)
摘要: ``` def logger(msg): def log_message(): print('Log:', msg) return log_message 返回的是函数 log_hi = logger('Hi!') 此时 相当于 ,`Hi msg` log_hi() def html_tag(tag 阅读全文
posted @ 2017-06-19 22:49 2021年的顺遂平安君 阅读(225) 评论(0) 推荐(0)
摘要: 和`sort()` 输出结果: Sorted Variable: [1, 2, 3, 4, 5, 6, 7, 8, 9] Original Variable: [1, 2, 3, 4, 5, 6, 7, 8, 9] 如果: 输出的结果是: None _Tuple_ 不能使用 ,只能定义一个新的变量 阅读全文
posted @ 2017-06-19 20:42 2021年的顺遂平安君 阅读(186) 评论(0) 推荐(0)
摘要: sorted和sort() li = [9, 1, 8, 2, 7, 3, 6, 4, 5]s_li = sorted(li)print ('Sorted Variable: \t', s_li)li.sort()print ('Original Var... 阅读全文
posted @ 2017-06-19 20:42 2021年的顺遂平安君 阅读(54) 评论(0) 推荐(0)
摘要: def outer(): x = 'outer x' def inner(): x = 'inner x' print(x) inner() print(x) # 这里的`x`与`x = 'outer x... 阅读全文
posted @ 2017-06-19 20:26 2021年的顺遂平安君 阅读(55) 评论(0) 推荐(0)
摘要: ``` def outer(): x = 'outer x' def inner(): x = 'inner x' print(x) inner() print(x) 这里的 与`x = 'outer x'`处在同一个Enclosing outer() 运行结果: inner x outer x 使 阅读全文
posted @ 2017-06-19 20:26 2021年的顺遂平安君 阅读(947) 评论(0) 推荐(0)
摘要: 使用 到Github网站的时候提示: push declined due to email privacy restrictions 原因 在Github设置里有一个隐私选项 Block command line pushes that expose my email 所以如果本地的 里email地 阅读全文
posted @ 2017-06-19 14:44 2021年的顺遂平安君 阅读(833) 评论(0) 推荐(0)
摘要: 使用git push到Github网站的时候提示: push declined due to email privacy restrictions 原因 在Github设置里有一个隐私选项 Block command line pu... 阅读全文
posted @ 2017-06-19 14:44 2021年的顺遂平安君 阅读(55) 评论(0) 推荐(0)