elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


  Mostrar Mensajes
Páginas: [1]
1  Programación / Scripting / Re: Calculador de Binomio de Newton [Python] en: 17 Febrero 2022, 20:46 pm
a = int(input("ingresa el primer numero: \n"))
b = int(input("ingresa el segundo numero: \n"))
n = int(input("ingresa el exponente: \n"))
x = (a+b)**n
 
if n == 1:
   print(a,"+",b)
   print(x)
if n == 2:
   print("%d^2 + 2*%d*%d + %d^2" % (a,a,b,b))
   print (x)
if n == 3:
   print("%d^3 + 3*%d^2*%d + 3*%d*%d^2 + %d^3" % (a,a,b,a,b,b))
   print(x)
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines