Python check function

Sometimes the screen cannot be cut for the computer test, what should I do if I forget to use the function?

1. Check available modules

import sys
for m in sys.modules:
    print(m)

2. Check documents 

Take the math module as an example

Check the help documentation of modules

import math
print(help(math))

Check function list

import math
print(dir(math))

Check the help document of the function

import math
print(help(math.ceil))

 

Guess you like

Origin blog.csdn.net/weixin_36389889/article/details/105111208