Created
March 4, 2011 09:53
-
-
Save gdemir/854414 to your computer and use it in GitHub Desktop.
time.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| #-*-coding:utf-8-*- | |
| from time import * | |
| def faktoriyel(n): | |
| if n <=1: | |
| return 1 | |
| else: | |
| return n * faktoriyel(n - 1) | |
| n = input("faktöriyeli hesaplanacak sayı?") | |
| ilk = time() | |
| sonuc = faktoriyel(n) | |
| son = time() | |
| print "%d! = %d | geçen süre = %f" % (n, sonuc, son - ilk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment