0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
3 Posted Topics
Hi [CODE=python]def factorial(number): if number == 1: #1! = 1 return number else: #n! = n * (n-1)! return number * factorial(number-1) # print 7! print factorial(7) [/CODE]
Hi, You can use functions like this: [CODE]def static_num(): static_num.x += 1 return static_num.x static_num.x = 0 if __name__ == '__main__': for i in range(10): print static_num() [/CODE]
The End.
zaghaghi