Python学习笔记(函数库的引用)

Python对库函数引用的方式
第一种方式在程序头部增加:

import<库名>

例如:import math

>>>import math
>>>math.sqrt(a)

第二种引用方式:

from <库名> import <函数名>
from <库名> import *

例如:

>>>from math import *
>>>sqrt(a)
发布了48 篇原创文章 · 获赞 25 · 访问量 2453

猜你喜欢

转载自blog.csdn.net/qq_43628959/article/details/96499088