digit order

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 19:01:58 +03:00
parent 104be53ebe
commit 6e182d0c2a
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 15 additions and 0 deletions

10
digit.order.2.py Normal file
View File

@ -0,0 +1,10 @@
n = int(input('Bir sayı giriniz:'))
digits = []
while n > 0:
r = n % 10
digits.append(r)
n //= 10
for digit in reversed(digits):
print(digit, end=' ')

5
digit.order.py Normal file
View File

@ -0,0 +1,5 @@
n = int(input('Bir sayı giriniz:'))
s = str(n)
for c in s:
print(c, end=' ')