发布时间:2019-06-21 17:36:01编辑:auto阅读(1938)
环境配置
Python
注释
单行注释:
# this is a comment.
'''
This is first line of comment.
This is second line of comment.
'''
变量
input 和 print
name = input("Please input your name: ")
age = input("Please input your age: ")
print("Hello World, hello Pyhon!")
输出单个和多个变量。 例如:
print("His name is %s", name)
格式化输出
print("His name is {}".format(name))
print("His name is %s"%name)
类型转换
命名规则
运算符优先级
age = 0
#age = 6 和print是属于同一代码逻辑块。
if name == "xiaolongtu":
age = 6
print("The age is {}".format(age))
#age = 6 和print不属于同一代码逻辑块。
if name == "xiaolongtu":
age = 6
print("His age is {}.format(age))
上一篇: python pymyssql模块安装
下一篇: python 基础学习 switch 语
51027
50409
41023
37886
32351
29250
28130
22967
22929
21257
1131°
1836°
1482°
1419°
1706°
1509°
2170°
3741°
3671°
2583°