Skip to content
Snippets Groups Projects
Commit 57126882 authored by Yineth Melissa Pérez Ayala's avatar Yineth Melissa Pérez Ayala
Browse files

Ejercicio 2

parent ad78f6ee
No related branches found
No related tags found
No related merge requests found
import math
print("ingrese la fila que desea ver")
n=(input())
linea=[]
if n.isnumeric():
n=int(n)
for i in range(n+1):
linea.append(math.comb(n,i))
print(linea)
else:
print("valor no válido")
print("ingrese el número de filas que desea ver")
a=int(input())
entradas=[]
print("ingrese las",a ,"filas que desea ver")
for i in range(a):
b=int(input())
entradas.append(b)
salidas=[]
for n in entradas:
linea=[]
n=int(n)
for i in range(n+1):
linea.append(math.comb(n,i))
salidas.append(linea)
print (salidas)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment