<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Digits on Python Exercises</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/tags/digits/</link><description>Recent content in Digits on Python Exercises</description><generator>Hugo</generator><language>fa-ir</language><lastBuildDate>Sat, 06 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://amirmahdikahdouii.github.io/Python-Exercises/tags/digits/index.xml" rel="self" type="application/rss+xml"/><item><title>تعداد ارقام فاکتوریل</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/027-factorial-digit-count/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/027-factorial-digit-count/</guid><description>&lt;p&gt;&lt;strong&gt;#027&lt;/strong&gt; · &lt;strong&gt;Factorial Digit Count&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/027-factorial-digit-count/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="سوال"&gt;سوال&lt;/h1&gt;
&lt;p&gt;برنامه ای بنوسید که عددی را از ورودی بخواند و مشخص کند فاکتوریل عدد چند رقمی است.&lt;/p&gt;
&lt;h2 id="input"&gt;Input:&lt;/h2&gt;
&lt;p&gt;ورودی عددی بین 1 تا 100 خواهد بود&lt;/p&gt;
&lt;h2 id="output"&gt;Output:&lt;/h2&gt;
&lt;p&gt;در تنها سطر خروجی، تعداد رقم های فاکتوریل عدد ورودی را چاپ کنید&lt;/p&gt;
&lt;h1 id="example"&gt;Example:&lt;/h1&gt;
&lt;h2 id="test1-input"&gt;Test1 Input:&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;5
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="test1-output"&gt;Test1 Output:&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;3
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="explain-test1"&gt;Explain test1:&lt;/h2&gt;
&lt;p&gt;فاکتوریل عدد 5 برابر با 120 خواهد بود که عددی ۳ رقمی است.&lt;/p&gt;</description></item><item><title>جریمه سرعت با فاکتوریل</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/004-speed-fine-factorial/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/004-speed-fine-factorial/</guid><description>&lt;p&gt;&lt;strong&gt;#004&lt;/strong&gt; · &lt;strong&gt;Speed Fine Factorial&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/004-speed-fine-factorial/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;پلیس راه شهر کاراجا، تصمیم گرفته تغییراتی در برگه جریمه ایجاد کند تا شهروندان شهر کاراجا را تضویق به رعایت مقررات راهنمایی و رانندگی کند.&lt;/p&gt;
&lt;p&gt;برای این منظور اگر راننده ای سرعت مجاز را رعایت نکرده باشد، فاکتوریل بزرگترین رقم عدد میزان اختلاف سرعت با حد مجاز را به عنوان پاداش جریمه به برگه جریمه راننده اضافه میکند.&lt;/p&gt;</description></item><item><title>حذف ارقام فرد</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/024-remove-odd-digits/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/024-remove-odd-digits/</guid><description>&lt;p&gt;&lt;strong&gt;#024&lt;/strong&gt; · &lt;strong&gt;Remove Odd Digits&lt;/strong&gt; · &lt;code&gt;strings&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/024-remove-odd-digits/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
برنامه ای بنویسید که عددی را از ورودی بخواند و ارقام فرد آن را حذف و عدد را چاپ کند.
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>حذف بازه‌ای از ارقام</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/007-remove-digit-range/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/007-remove-digit-range/</guid><description>&lt;p&gt;&lt;strong&gt;#007&lt;/strong&gt; · &lt;strong&gt;Remove Digit Range&lt;/strong&gt; · &lt;code&gt;strings&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/007-remove-digit-range/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;برنامه ای بنویسید که عددی را بخواند و تکه ای از آن را حذف کند و در خروجی نمایش دهد.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در خط اول ورودی به شما n داده میشود.
در خط دوم به شما عدد m داده میشود.
در خط سوم نیز عدد اصلی به شما داده میشود.
n, m, a &amp;gt; 0, a &amp;lt; n,m
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها خط خروجی، عدد حاصل را چاپ کنید.
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه"&gt;ورودی نمونه:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
8
5
1234569875462
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه"&gt;خروجی نمونه:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
123455462
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>شمارش ارقام زوج</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/025-count-even-digits/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/025-count-even-digits/</guid><description>&lt;p&gt;&lt;strong&gt;#025&lt;/strong&gt; · &lt;strong&gt;Count Even Digits&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/025-count-even-digits/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;برنامه ای بنویسید که تعدادی عدد بخواند و تعداد رقم های زوج را در مجموع چاپ کند.
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>عدد m-reverse</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/013-m-reverse-number/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/013-m-reverse-number/</guid><description>&lt;p&gt;&lt;strong&gt;#013&lt;/strong&gt; · &lt;strong&gt;M-Reverse Number&lt;/strong&gt; · &lt;code&gt;strings&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/013-m-reverse-number/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;ایلیا یک بازی ترتیب داده به این صورت که یک عدد دلخواه صحیح را خوانده و آنرا به یک عدد m-reverse تبدیل می کند.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;عدد m-reverse از عدد n هر m رقم آن را از سمت راست جدا نموده و مقلوب آن را جایگزین عدد جدید می نماید.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در خط اول ورودی عدد صحیح m که انداره جدا کننده شماست، داده میشود.
در خط دوم ورودی، عدد صحیح n به شما داده میشود.
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها خط خروجی، عدد m-reverse را چاپ کنید.
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه-1"&gt;ورودی نمونه 1:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
2
345678
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه-1"&gt;خروجی نمونه 1:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
436587
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه-2"&gt;ورودی نمونه 2:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
3
12345645
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه-2"&gt;خروجی نمونه 2:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
21543546
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>عدد تنک</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/023-thin-number-check/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/023-thin-number-check/</guid><description>&lt;p&gt;&lt;strong&gt;#023&lt;/strong&gt; · &lt;strong&gt;Thin Number Check&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/023-thin-number-check/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
برتامه ای را بنویسید که عددی را از ورودی بخواند و مشخص کند عدد وارد شده عدد تنک هست یا خیر.
عدد تنک عددی است که تعداد ارقام صفر آن از تعداد ارقام غیر صفر آن بیشتر باشد.
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>عدد غالب</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/019-dominating-number-check/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/019-dominating-number-check/</guid><description>&lt;p&gt;&lt;strong&gt;#019&lt;/strong&gt; · &lt;strong&gt;Dominating Number Check&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/019-dominating-number-check/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
A dominating number is a positive integer that has more than half of its digits equal.
For example, 2022 is a dominating number because three of its four digits are equal to 2.
But 2021 is not a dominating number.
Input:
We give You a positive integer number.
Output:
if the given number was dominating number, Print &amp;#34;YES&amp;#34; if it&amp;#39;s not, print &amp;#34;No&amp;#34;.
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>مجموع توان ارقام</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/018-digit-power-sum/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/018-digit-power-sum/</guid><description>&lt;p&gt;&lt;strong&gt;#018&lt;/strong&gt; · &lt;strong&gt;Digit Power Sum&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/018-digit-power-sum/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
The Number 512 is interesting because it is equal to the sum of its digits raised to some power:
5 + 1 + 2 = 8, and (8 ** 3) = 512.
Another example of a number with this property is 614656 = 28 ** 4.
Input:
we give you a number with at least two digits!
Output:
If the given number is &amp;#39;digit power sum&amp;#39; Print &amp;#34;YES&amp;#34; if it&amp;#39;s not, print &amp;#34;NO&amp;#34;!
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>معکوس n رقم به n رقم</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/010-reverse-n-digits-batch/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/010-reverse-n-digits-batch/</guid><description>&lt;p&gt;&lt;strong&gt;#010&lt;/strong&gt; · &lt;strong&gt;Reverse N Digits at a Time&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/010-reverse-n-digits-batch/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;برنامه ای بنویسید که دو عدد طبیعی a, n را بخواند و n رقم به n رقم در عدد a، مغلوب آن را محاسبه و خروجی دهد.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در خط اول ورودی شمارنده یا عدد n به شما داده میشود.
در خط دوم عدد به شما داده میشود
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها خط خروجی، عدد حاصل را چاپ کنید.
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه"&gt;ورودی نمونه:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
3
1234567
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه"&gt;خروجی نمونه:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
100432765
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>معکوس کردن n رقم اول</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/006-reverse-first-n-digits/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/006-reverse-first-n-digits/</guid><description>&lt;p&gt;&lt;strong&gt;#006&lt;/strong&gt; · &lt;strong&gt;Reverse First N Digits&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/006-reverse-first-n-digits/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;برنامه ای بنویسید که عددی را از ورودی بخواند و تا رقم n ام آن را مغلوب، و عدد حاصل را چاپ کند.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در خط اول برنامه، عدد ورودی به شما داده میشود.
در خط دوم n به شما داده میشود که تعداد ارقامی است که باید مغلوب کنید.
نکته: اگر عدد n از تعداد ارقام عدد ورودی بیشتر بود، کل عدد را مغلوب کنید.
0 &amp;lt;= n &amp;lt;= 6
0 &amp;lt; number &amp;lt; 100,000
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها خط خروجی، عدد حاصل را چاپ کنید.
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>