一、python的运行方式
1、命令行交互shell:临时性测试,比较简短的代码
2、文件形式执行:
python最流行的IDE:pycharm
设置代码模板 ;字体设置;解释器设置
3、pycharm常用快捷方式
CTRL + 悬浮/单击鼠标左键:简介/进入代码定义
CTRL + /:行注释/取消行注释
CTRL + Shift + /:块注释
CTRL + Alt + L:代码格式化
CTRL + D:复制选定的区域或行
CTRL + R:替换
Shift + F10:运行
二、输入input
1、用户名密码输入,接收用户从键盘输入,并将结果输出
username = input("please input your name:")
password = input("please input your password:")
print = (username,password)
2、用户名密码输入,优化:将密码隐藏
username = input("please input yout name:")
password = getpass.getpass("please input password:")
print("your name is:",username)
print("your password is:",password)
三、输出print
具体用法: