Está en la página 1de 2

Nombre: J.

Micaela Sáenz Molina

C.I.:8464832

Fecha:15 de mayo de 2019

Docente: Johnny Felipez Andrade

SEGUNDO PARCIAL INF 111

1.
def dentro(x1,y1,x2,y2,x,y):
if x <= x1 or x <= x2:
if y <= y1 or y <= y2:
sw = True

return sw

a,b,c,d=map(int,input().split())
x,y = map(int,input().split())
d = dentro(a,b,c,d,x,y)
if d == True:
print("Dentro")
else:
print("Fuera")

Prueba:

1153

22

Dentro

2.
def Cambia(a,b,c):
v =[a,b,c]
ve =v[1],v[2],v[0]
return ve

c1,c2,c3 = input().split()
ve = Cambia(c1,c2,c3)
print(*ve)

Prueba:

Tomas David Habram

David Habram Tomas


3.
import math
def Promedio(a,b,c,d,e,f,g,h,i,j):
s = a+b+c+d+e+f+g+h+i+j
n = s/10
return n

def desviacion(a,b,c,d,e,f,g,h,i,j):
v =[a,b,c,d,e,f,g,h,i,j]
m =len(v)
p = Promedio(a,b,c,d,e,f,g,h,i,j)
s = 0
for i in range(m):
s = s + math.pow((v[i]-p),2)
d = math.pow((s/9),0.5)
return d

a,b,c,d,e,f,g,h,i,j = map(float,input().split())
p = Promedio(a,b,c,d,e,f,g,h,i,j)
d =desviacion(a,b,c,d,e,f,g,h,i,j)

print("El promedio es:",p)


print("La desviacion es:",d)

Prueba:

1.9 2.5 3.7 2 1 6 3 4 5 2

El promedio es: 3.1100000000000003

La desviación es: 1.5573838462127583

También podría gustarte