Advertisement
matisarnowski

trojkat_pascala

Oct 4th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import math
  2.  
  3. potega_dwumianu = int(input("Wprowadź potęgę dla , której chcesz wygenerować ostatni wiersz 'Trójkąta Pascala.': "))
  4. ilosc = potega_dwumianu + 1
  5.  
  6. for i in range(ilosc):
  7.     liczba = i + 1
  8.     for j in range(liczba):
  9.         print(int(math.factorial(i)/(math.factorial(j)*math.factorial(i-j))),end = ' ')
  10.     print('\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement