Дано трехзначное число. Найдите сумму его цифр. n = int(input()) a = n // 100 b = n // 10 % 10 c = n % 10 print(a + b + c) Как найти число десятков в числе python n = int(input()) print(n // 10 % 10) Последнее число a = int(input()) print(a % 10) Парты a = int(input()) b = int(input()) c = int(input()) print(a // 2 + b // 2 + c // 2 + a % 2 + b % 2 + c % 2) Дано положительное действительное число X. Выведите его дробную часть. x = float(input()) print(x - int(x)) X = float(input()) Y = int(X) print(X - Y) Выведите его первую цифру после десятичной точки. x = float(input()) print(int(x * 10) % 10) print(str(float(input()) % 1)[2])
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter