文章目录 1. 导入模块2. 导入模块某函数3.导入模块所有内容 经常需要用到标准库函数,记录下导入的小知识 1. 导入模块 import 模块名 使用时需要用模块名作为前缀 import math math.log2(16) 2. 导入模块某函数 from 模块名 import 函数名 使用时可以直接使用函数名,无需前缀 from math import sqrt sqrt(16) 3.导入模块所有内容 from 模块名 import * 使用时可以直接函数名,无需前缀 from math import * sqrt(16)