forked from ELC/python-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter6.py
More file actions
21 lines (13 loc) · 694 Bytes
/
chapter6.py
File metadata and controls
21 lines (13 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
####################################################
## 6. Módulos
####################################################
import math # Importar todo el módulo con nombre
math.sqrt(16) # => 4.0
from math import ceil, floor # Importar sólo partes específicas
ceil(3.7) # => 4.0
floor(3.7) # => 3.0
from math import * # Importar todas las partes de un módulo | NO RECOMENDABLE
import math as m # Es posible utilizar alias para los módulos
math.sqrt(16) == m.sqrt(16) # => True
math.__doc__ # => This module provides access to the mathematical functions
# defined by the C standard.