1 IDE 运行python

新建项目

新建hello.py文件
输入:

print('hello world') 

image.png

运行hello.py

右键 运行
image.png

2 命令行 运行 python

到保存那个文件的地址下运行 hello.python
image.png
开心不,运行成功!

3 小试牛刀

  • 解一道题目
    请计算:19+2*4-8/2
    代码如下:
#coding:utf-8

"""
请计算:80+2*5-6/3
"""

a = 80+2*5-6/3
print a

上面代码中,第一行,不能少,本文件是能够输入汉字的,否则汉字无法输入。
运行: 结果为 88
image.png

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐