fibonacci.py
#!/usr/bin/env python# -*- coding: utf-8 -*-#www.ethemsulan.coma=0b=1while b<100:print b
b,a=a+b,b
pythonda a,b=a ya atanacak deger, b ye atanacak deger gibi bir kullanım var.
Kodu çalıştırısak,
Ethem@Ethem ~ $ chmod 777 fibonacci.py
Ethem@Ethem ~ $ ./fibonacci.py
1
1
2
3
5
8
13
21
34
55
89
Ethem@Ethem ~ $
+x yerine 777 değerini de verebiliriz.
Hiç yorum yok:
Yorum Gönder