Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # przykład do uruchomienia - definicja i wywołania
- #
- def testowa(stopien, lista_wsp, argument):
- argument = argument * argument
- if stopien == 0:
- return lista_wsp[stopien]
- else:
- return argument * testowa(stopien - 1, lista_wsp, argument) + lista_wsp[stopien]
- wynik = testowa(3, [6, 8, -2, 23], 2)
- print(wynik)
- print(wynik==98831)
- #
- wynik = testowa(3, [6, 8, -2, 23], 5)
- print(wynik)
- print(wynik==36621218723)
- ##
- wynik = testowa(3, [6, 8, -2, 23], 2)
- print(wynik)
- print(type(wynik) is int)
- wynik = testowa(3, [6, 8, -2, 23], 5)
- print(wynik)
- print(type(wynik) is int)
Advertisement
Add Comment
Please, Sign In to add comment