How can I import multiple items from a module and rename them in Python?

后端 未结 2 1455
粉色の甜心
粉色の甜心 2021-01-04 04:50

I want to import atan and degree from math and rename them both.

I have tried using this:

from math import ata         


        
2条回答
  •  长发绾君心
    2021-01-04 05:19

    You have to use the as for each item:

    from math import atan as t, degree as z
    

    This imports and renames them all.

提交回复
热议问题