python中一些变量最基本的操作
#变量
msg = 'Hello' #用变量代表消息
print(msg)
'''
拼写要小心,否则-----
Traceback (most recent call last):
File "variable.py", line 3, in <module>
print(mssg)
NameError: name 'mssg' is not defined
'''
name = 'jerry'
name.title() #让变量首字母大写
'''
title()
upper()让整个变量的字符大写
lower()让整个变量的字符小写
'''
fn = 'ada'
ln = 'lovelace'
print(f'{fn},{ln}') #同时打印两个变量
#变量---删除空白
fl = ' python '
fl.rstrip() #结果:' python'
fl.lstrip() #结果:'python '
fl.strip() #结果:'python'
'''
拓展-----运算
+,-,*,/ 加减乘除
** 乘方
// 取整
...
其他的自己上网去查.
'''