Advertisement
TristanSld

collatz theory

Feb 22nd, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3.  
  4. import module
  5.  
  6.  
  7. print "Lütfen bir sayı aralığı giriniz: "
  8. try:
  9.     a = raw_input("İlk sayı: ")
  10.     b = raw_input("İkinci sayı: ")
  11.     ils, iks  = module.aralik(a,b)
  12.     while ils < iks:
  13.         module.collatz(ils)
  14.         ils += 1
  15.     if module.collatz(a) != 1 :
  16.         print module.collatz(ils)
  17.     else:
  18.         print "Girdiğiniz sayı aralığındaki bütün işlemlerin sonucu %s" %(module.collatz(ils))
  19. except ValueError:
  20.     print "Lütfen harf değil sayı giriniz!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement