source: https://www.pexels.com/photo/office-working-app-computer-97077/ 注:这篇适用于用MAC 开发的developer 身为程式开发者,很大一部分的时间是在用command line 做事,如果能把command line 调整成好用又酷炫的模样,不只是效率提升非常多,用起来爽度也比较高 像下面这样子的command line 是不是比内建的有意思多了? 图片来源:https://github.com/bhilburn
一.作用域 对于变量的作用域,执行声明并在内存中存在,该变量就可以在下面的代码中使用. if 1==1: name = 'wupeiqi' print name 二.三元运算 result = 值1 if 条件 else 值2 如#果条件成立,值1付给result否则值2付给result 如果条件为真:result = 值1如果条件为假:result = 值2 name = 'sb' if 1==1 else '2b' input = raw_input() result = '2b'