首页 > 解决方案 > 导入数学模块 - Python

问题描述

我正在运行一些基本的 python 函数。当我尝试导入数学模块时,它似乎无法正常工作。这是我收到的代码。

   In [5]: import math    

   In [6]: 2^3
   ...: (2)^3
   ...: 2^(3)
   ...: 2**3
   ...: improt math
  File "<ipython-input-6-92c86fb66a5e>", line 5
improt math
          ^
SyntaxError: invalid syntax

In [7]2**3
Out [7]: 8

In [8]: import math
...: math.sqrt (81)
...: 
...: math
...: math .sqrt(81)
...: sqrt(81)
...: 2**3

除了玩弄基本功能之外,我还没有配置程序或做任何事情。但它没有导入数学模块。知道为什么吗?

标签: python-3.xpython-import

解决方案


你有一个错字 -improt在第 5 行


推荐阅读