Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #yield example
- #It helps the function to return a generator object
- from __future__ import print_function #Compatibilidade func print python 2/3
- import math
- def Fatorial(Qtde):
- ListIn = range(Qtde)
- for i in ListIn:
- yield math.factorial(i)
- Qtde = 10
- Resp = Fatorial(Qtde)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement