Python 在sublime 中注释方法
程序中记录备注提示代码所完成的事情 增强程序的可读性
#开头 单行注释
‘’‘ 三个单引号为多行注释 ’‘’
Python程序中是默认不支持中文 程序开头加#encoding=utf-8
存储数据的容器叫变量
常量 变量 标识符 变量名区分大小写
变量命名 驼峰命名法 userName/userNameAre小驼峰 UserName大驼峰
Type(b)查看b的变量类型
格式化输出
Score=100
Prit(“my English score is %d”%Score)
machScore=120
print(“my English score is %d,,,,,my mach score is %d”%(Score,machScore))
print(“11111111111 77777777777”)
输出11111111111
77777777777
Python3中的input和python2中的raw_input用法一样
time.sleep(秒)延时设置
例:
#python’自动不识别汉字 引用包
#encoding=UTF-8 ()
#延时命令引用
import time
#设置输入并保存变量值
name=input("what's your name:")
phoneNumber=input("what's your number:")
adress=input("where:")
QQ=input("QQ:")
#打印等待
print("xitongdayinzhong:3...")
time.sleep(1)
print("xitongdayinzhong:2...")
time.sleep(1)
print("xitongdayinzhong:1...")
time.sleep(1)
#打印结果
print("=============================")
print("name:%s number:%s adress:%s QQ%s"%(name,phoneNumber,adress,QQ))
print("=============================")