Sie sind auf Seite 1von 2

## EQUIPOS

import random

equipos=['Emelec','Barcelona','Macara','Aucas','Delfin','Manta']
ptosAc=[19,6,13,25,32,40]
fecha1=[]
fecha2=[]
total=[]

suma=0

for i in range(len(equipos)):
puntos = [0, 1, 3]
x = random.choice(puntos)
y = random.choice(puntos)
fecha1.append(x)
fecha2.append(y)
suma = ptosAc[i] + x + y

total.append(suma)

copia=total[:]
total.sort(reverse=True)

print("*** TABLA DE POSICIONES SIN ORDENAR ***")

print('\nEquipos \t AC \t F1 F2 T\n')
for i in range(len(equipos)):
print("%7s \t %d \t %d \t %d \t %d "%
(equipos[i],ptosAc[i],fecha1[i],fecha2[i],copia[i]))

print()

print("*** TABLA DE POSICIONES FINAL ***")


print('\nEquipos \t AC \t F1 F2 T\n')

for i in total:
pos=copia.index(i)
print("%7s \t %d \t %d \t %d \t %d "%
(equipos[pos],ptosAc[pos],fecha1[pos],fecha2[pos],copia[pos]))

################################################
TALLER EJERCICIO 1

lis=[]
contador=0
a=""
num=[]
palabras=[]
contador=0

while(a!="-1"):
a=input("Ingrese un dato: ")
lis.append(a)

print("Su lista es: %s" %lis)


for elem in lis:
if elem.isdigit():
num.append(int(elem))
elif elem.isalpha():
palabras.append(elem)

promedio = sum(num)/len(num)

repetidos=[]

for i in palabras:
if i not in repetidos:
repetidos.append(i)

print("Repetidos", repetidos)

mayor=0
for elem in num:
if mayor<=elem:
mayor=elem
menor=num[0]
for elem in num:
if menor>=elem:
menor=elem

print("Los numeros ingresados son: %s" %num)


print("El promedio de los numeros ingresados es: %.2f" %promedio)
print("Numero mayor:%d" %mayor)
print("Numero menor: %d" %menor)

Das könnte Ihnen auch gefallen