1.调用外部的.py文件
cmd->进入.py文件的目录下->python +.py文件的文件名
2.用PyCharm
输出:print(“hello world”)#双引号输出字符串
print(‘hello world’)#单引号输出字符串
print(“hello Bob’s brother”)#字符串中包括单引号
print(‘say:“please”’)#字符串中包括双引号
print(200+200)#输出运算
结果:hello world
hello world
hello Bob’s brother
say:“please”
400
输入:name = input(“please input your name:”)
print(name)
num = input(“please a int num:”)
#print(num+2)报错,因为input接收的值均默认为字符串
print(int(num)+2)
结果:please input your name:Bala
Bala
please a int num:2
4