Skip to content

Instantly share code, notes, and snippets.

@inceabdullah
Created November 24, 2020 06:01
Show Gist options
  • Save inceabdullah/31ee197fd76195c33fc5a591d8960712 to your computer and use it in GitHub Desktop.
Save inceabdullah/31ee197fd76195c33fc5a591d8960712 to your computer and use it in GitHub Desktop.
Gün ay ve yılın rakamlarının toplamı
pin = []
g = int(input("gün:"))
a = int(input("ay:"))
y = int(input("yil:"))
def rakam_toplami (x):
if x < 10:
return x
else:
return (x%10)+int(x/10)
while g >= 10 or a >= 10 or y >= 10:
g = rakam_toplami(g)
a = rakam_toplami(a)
y = rakam_toplami(y)
print("gün: %d, ay: %d, yıl: %d" % (g, a, y))
pin = [g,a,y]
print("pin[]:%s" % pin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment