---
title: "scipy的constants模块"
author: "cakin24"
date: "2017-08-03T23:39:52Z"
tags: []
categories: ["编程语言"]
slug: "scipy-constants"
draft: false
lastmod: "2017-08-03T23:39:52Z"
id: 2388245
url: "https://cakin24.iteye.com/blog/2388245"
---

**一 介绍**

scipy的constants模块包含了大量用于科学计算的常数

**二 代码**

01. `from scipy import constants as C`
02. `#圆周率`
03. `print(C.pi)`
04. `#黄金比例`
05. `print(C.golden)`
06. `#真空中的光速`
07. `print(C.c)`
08. `#普朗克常数`
09. `print(C.h)`
10. `#一英里等于多少米`
11. `print(C.mile)`
12. `#一英寸等于多少米`
13. `print(C.inch)`
14. `#一度等于多少弧度`
15. `print(C.degree)`
16. `#一分钟等于多少秒`
17. `print(C.minute)`
18. `#标准重力加速度`
19. `print(C.g)`

**三 运行结果**

3.141592653589793

1.618033988749895

299792458.0

6.62607004e-34

1609.3439999999998

0.0254

0.017453292519943295

60.0

9.80665