Cannot import Decimal module

前端 未结 2 1352
眼角桃花
眼角桃花 2021-01-25 22:40

I am trying to do some simple decimal math to practice with the Tkinter GUI, but for some reason I cannot import Decimal:

>>> from decimal import Decima         


        
2条回答
  •  無奈伤痛
    2021-01-25 23:20

    You called a file math.py, meaning it overrides the built-in math module and breaks everything that uses that module. Pick a different name, and the problem will go away.

提交回复
热议问题