Skip to content

Instantly share code, notes, and snippets.

@pasali
Created March 28, 2011 14:58
Show Gist options
  • Save pasali/890617 to your computer and use it in GitHub Desktop.
Save pasali/890617 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#-*-coding:utf-8-*-
while True:
try:
n = input("Sayıyı girin:")
toplam = 0
tektop = 0
sifirbes = 0
ters = " "
x = str(n)
while n:
a = n % 10
toplam += a
if a % 2 != 0:
tektop += 1
if a == 0 or a == 5:
sifirbes += 1
ters = ters + str(a)
n = n / 10
sayi = 1
for i in x:
if i != max(ters):
sayi += 1
else:
break
print "\nRakamlar toplamı=", toplam
print "Tek rakamların sayısı=", tektop
print "Sıfır veya beşlerin sayısı =", sifirbes
print "Sondan başa yazılış = ", ters
print "En büyük rakam =", max(ters), "(", sayi, ". sırada)"
print "En küçük rakam =", min(ters)
except NameError:
print "Sayı dedik da "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment