Created
November 24, 2020 06:01
-
-
Save inceabdullah/31ee197fd76195c33fc5a591d8960712 to your computer and use it in GitHub Desktop.
Gün ay ve yılın rakamlarının toplamı
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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