Python入门练习 2-11

40 阅读1分钟

回顾练习

image.png

image.png

float 浮点数介绍

float 就是小数, float() 可以将对应数据转化为浮点数。

image.png

float 练习一

image.png

image.png

整数取整取余

5÷3=125\div3=1\cdots2

image.png

不难看出,所谓整除就是,所谓取余就是 余数

练习一 :对 56 拆位

image.png

练习二

image.png

练习三

image.png

image.png

练习四

image.png

分支结构

image.png

运算符

image.png

练习一

image.png

练习二

image.png

练习三

image.png

练习四

image.png

练习五

image.png

练习六

image.png

修订 :

询问 : 明天的天气是什么 ?

回答 :如果是雨天或者雪天,输出 不去图书馆

否则,输出 去图书馆

练习七

image.png

练习八

image.png

练习九

image.png

练习十

image.png