python学习日记1-基础

变量名只能包含字母、数字、下划线

开头只能字母或者下划线 不能数字开头 不能包含空格 慎用数字1和字母O

单双引号效果一样 自由选择谁在外面 在外面的起作用

name.title() 单词首字母大写

name.upper() 单词全大写

name.lower()单词全小写 

+号用于拼接

\t 制表符

\n 换行符

name.rstrip() 删除空白

input() 用户输入

print在python3中是函数必须带括号,Python2中有些可不带括号

python可直接对整数执行加减乘除

猜你喜欢

转载自www.cnblogs.com/tangcupaigu/p/11105770.html