#英文字串首字母改为大写 st = "string" St = st[0].upper() + st[1:] 2016-10-22 后来了解到 python 内部有相关实现,感觉 python 好贴心~~~ >>> "hehe he hehe".capitalize() 'Hehe he hehe' >>> "hehe he hehe".title() 'Hehe He Hehe'
IDLE 内置函数==BIF==built-in function 默认地,内置函数都是紫色,字符串是绿色,关键字是橙色. tab:自动补全 Alt-P:前一个 Alt-N:下一个 列表的特性 列表看起来很像数组 python变量标识符没有类型,所以不用定义 列表中可以混合存储不同类型的数据 movies = ['The Holy Grail', "The Life of Brain", "The meaning of Life"] print(movies[1])