Python Shell是安装Python自带的一个实用的工具,Shell就是“壳”的意思。通过它我们可以和Python的解释器进行交流,让Python帮我们做一些事。

python 快 shell 快 python shell怎么用_python


1、进行运算

我们可以使用Python Shell来进行数值运算,这和我们平常使用的计算器一样。

A)做加法,

python 快 shell 快 python shell怎么用_python_02

B)做减法

python 快 shell 快 python shell怎么用_python_03

C)乘法、除法和幂运算

python 快 shell 快 python shell怎么用_python shell 内置命令_04

在Python中,乘法运算使用星号“*”来表示,幂运算使用两个星号“**”来表示,幂运算的两个星号之间不能有空格,必须是连续的。

我们平常工作中可以利用这一小功能来帮助我们解决一些计算问题。


2、输出一些有意思的东西

A)打印9x9乘法表

python 快 shell 快 python shell怎么用_Python入门_05

9x9乘法表

B)打印图形

python 快 shell 快 python shell怎么用_Python教程_06

python 快 shell 快 python shell怎么用_Python入门_07

python 快 shell 快 python shell怎么用_Python教程_08

大家可以先对着代码敲,可能还不是可以理解代码的具体意思,后面会相继讲解。