12.24 python学习笔记

1.算术运算

+  -  *  /  

// —— 结果取整

% ——取余

** —— 幂

2.数学函数

round()—— 四舍五入

abs()——绝对值

import math ——引入math模块

https://www.cnblogs.com/MingleYuan/p/10628503.html

3.if语句

price = 1000000
has_good_credit = True

if has_good_credit:
   down_payment = 0.1 * price
else:
    down_payment = 0.2 * price
print(f"Down payment :{down_payment}")

猜你喜欢

转载自www.cnblogs.com/zuotianmeichifan/p/12093610.html