>>> x = 3 >>> print(type(x)) <class 'int'> >>> x = 'Hello world.' >>> print(type(x)) <class 'str'> >>> x = [1,2,3] >>> print(type(x)) <class 'list'> >>> isinstance(3, int) True >>> isinstance('Hello world', str) True
ppt课件
>>>from th import floor
>>>floor(10.2)
10
25
math库解析
math库包括4个数学常数
ppt课件
26
math库解析
math库包括16个数值表示函数
ppt课件
27
math库解析
math库中包括8个幂对数函数
ppt课件
28
math库解析
math库包括六个“三角双曲函数
ppt课件
24
math库概述
首先使用保留字import引用该库
•第一种:import math 对math库中函数采用math.<b>()形式 使用
>>>import math >>>math.ceil(10.2) 11
• 第二种,from math import <函数名> 对math库中函数可以直接采用<函数名>()形式使用