Python学习笔记0121

2022-02-22  本文已影响0人  哈喽小朋友

20220121 day2
数学模块 match modules
import
ceil()
floor()
math.``ceil

format string
print(f"Down payment:{down_payment}")

logical operator 逻辑运算符-与或非

and
or
not

字符长度函数Len()

if/ elif/else的区别
先检查if,如果if为假,才运行elif.
在if和elif都为假的情况下,才会运行else。

so the difference is that the code always checks to see if an 'if' statement is true, checks 'elif' statements only if each 'if' and 'elif' statement above it is false,

and 'else' runs only when the conditions for all attached 'if' and 'elif' statements are false.Feb 26, 2021

Project :Weight Converter

input()
是用来存储用户输入的数值的

上一篇 下一篇

猜你喜欢

热点阅读