python中字符串注意事项

来源:互联网 发布:陈巧生香炉官网淘宝网 编辑:程序博客网 时间:2024/06/17 13:31
字符串输入和输出
userName = input('请输入用户名:')
print("用户名为:%s"%userName)
 
password = input('请输入密码:')
print("密码为:%s"%password)
 
1.字符串在单引号和双引号之间
2.字符串无法修改
3.三引号适合创建多行字符串
4.字符串可以进行加法和乘法