In [2]:
def cuadrado(x):
return x**2
In [3]:
cuadrado(9+1)
Out[3]:
import math
In [7]:
((5-(1-(3-math.exp(1/8))))/(3*(4-2)*(2-(3/8))))-(math.factorial(2)*(-1**3))+math.sin(0.98*math.pi)
Out[7]:
In [9]:
x='abcdefghijklm'
In [10]:
x[0]+x[1]+x[2]+x[3].upper()+x[4]+x[5]+x[6].upper()+x[7]+x[8]+x[9].upper()+x[10]+x[11]+x[12].upper()
Out[10]:
In [11]:
def car(lista):
return(lista[0])
In [12]:
l1 = [1,2,3,4]
In [13]:
l2 = ['a','b','c','d']
In [14]:
car(l1)
Out[14]:
In [15]:
car(l2)
Out[15]:
In [16]:
l3=[l1,l2]
In [17]:
car(l3)
Out[17]:
In [18]:
def cdr(lista):
return(lista[1:])
In [19]:
cdr(l1)
Out[19]:
In [20]:
cdr(l2)
Out[20]:
In [21]:
cdr(l3)
Out[21]:
In [ ]: