<?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>Lucky-Digits on Python Exercises</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/tags/lucky-digits/</link><description>Recent content in Lucky-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/lucky-digits/index.xml" rel="self" type="application/rss+xml"/><item><title>عدد تقریبا خوش‌شانس</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/022-nearly-lucky-number/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/022-nearly-lucky-number/</guid><description>&lt;p&gt;&lt;strong&gt;#022&lt;/strong&gt; · &lt;strong&gt;Nearly Lucky 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/022-nearly-lucky-number/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal
representations contain only the lucky digits 4 and 7.
For Example numbers: 47, 477, 4 are lucky and 5, 17, 467 are not.
Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of
lucky digits in it is a lucky number.
Input:
the only line contains an integer n (1 Because Count of lucky number in 400447 is a lucky number also (4)!
### Example Input:
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;7747774
&lt;/code&gt;&lt;/pre&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;### Example Output:
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;YES
&lt;/code&gt;&lt;/pre&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
### Example Input:
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;1000000000000000000000000000
&lt;/code&gt;&lt;/pre&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;### Example Output:
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;NO
&lt;/code&gt;&lt;/pre&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>