前言
Python是一门脚本语言,不需要先编译,可以直接读取文本文件,边解释边执行。
关键字
# 关键字
import keyword
print(keyword.kwlist) # 所有python的关键字
注释
单行注释 #
# 单行注释
多行注释 '''/"""
'''
多行注释
'''
"""
多行注释
"""
# 字符串换行
txt = """
Conquer
Byte
Studio
"""
多行语句
# 多行语句
a = "Conquer"
b = "Byte"
c = "Studio"
txt = a + " " + \
b + " " + \
c
print(txt)
如果是在数组、元组等里面的换行不需要斜杠
输出和输入函数
输出函数:print
print("Conquer Byte")
输入函数:input
a = input("请输入:")
print(a)