Skip to content

Instantly share code, notes, and snippets.

@pasali
Created May 19, 2011 12:05
Show Gist options
  • Save pasali/980599 to your computer and use it in GitHub Desktop.
Save pasali/980599 to your computer and use it in GitHub Desktop.
alistirmalar
def fak(n):
if n < 0:
print "Negatif sayıların faktöriyeli alınamaz."
return
else:
if n == 0 or n == 1:
return 1
else:
return n * fak(n-1)
def ters_arama(n,a):
for i in n.values():
if i == a:
sirasi = n.values().index(i)
anahtar = n.keys()[sirasi]
print anahtar
n.pop(anahtar)
def fi(n):
fib = { 0 : 0, 1 : 1, 2 : 1, 3 : 2, 4 : 3, 5 : 5, 6 : 8, 7 : 13, 8 : 21, 9 : 34, 10 : 55}
if n > 0 and type(n) == type(4):
if n in fib.keys():
return fib[n]
else:
return fi(n-2) + fi(n-1)
else:
print "Pozitif tamsayı giriniz !"
def sinirsiz_toplam(*args):
tp = 0
for i in args:
tp += i
print tp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment