[1]: import this
The Zen of Python, by Tim Peters
numpy
scipy
matplotlib
#!/usr/bin/env python # -*- coding: utf-8 -*- # Comentario para um print
print(7 * 3)
a = b + c
x = x * f + \
x0 * f
l = [1, 2,
3, 4]
d = { 'a' : 1, 'b' : 2 }
if a > x and \ if a > x and \
b < y: b < y:
print("texto") print("texto")
# para i na lista
for i in [104, 234, 654, 378, 798]:
if i % 3 == 0:
print( i, "/3 = ", i/3)
# jeito arrumadinho de dizer
print("%d/3 = %d" % (i, i/3))
tupla = (0,1,2,3,4,5)
lista = list(tupla) # [0,1,2,3,4,5]
>>> d.keys()
['chave']
>>> d.values()
['valor']
>>> d.items()
[('chave', 'valor')]
In [1]: d = dict(chave = 'valor', numero = 3)
In [2]: d Out[2]: {'chave': 'valor', 'numero': 3}
# Apagando e limpando
CRIAR UM ARRAY:
np.array([1, 2, 3, 4])
# Jeito errado
np.array(1, 2, 3, 4)
Verificar o shape:
var = np.array(30)
np.shape(var)
var.shape
VERIFICAR O TAMANHO:
len(var)