Загрузка...

3.22 – Strong Number Program | Python Programming – New Series

Welcome to the Python Programming – Complete Course (New Series) by Burle Sharma.

In this class (3.22), we solve an important advanced number problem:

👉 Write a program to accept a number and check whether it is a Strong number or not.

A Strong number is a number whose sum of the factorial of its digits is equal to the number itself.

In this video, I have:

✔ Written the expected output clearly
✔ Explained the problem statement properly
✔ Written the complete program
✔ Performed a detailed dry run step-by-step
✔ Executed the program and verified the output

🎓 What You’ll Learn in This Video

• Understanding Strong number concept
• Extracting digits using while loop
• Calculating factorial using loop
• Combining multiple loops in one program
• Using accumulator variable (sum)
• Performing detailed dry run
• Writing structured and logical programs

🧠 Program: Check Strong Number

Example:

Input: 145

Digits → 1, 4, 5

Factorial Sum:
1! + 4! + 5! = 1 + 24 + 120 = 145

Output:
Strong Number

Logic

✔ Accept a number from the user
✔ Store original number
✔ Initialize sum = 0

✔ Use loop to process each digit:
 • Extract digit using %
 • Remove digit using //

✔ For each digit, calculate factorial
✔ Add factorial to sum
✔ Compare sum with original number
✔ If equal → Strong number
✔ Else → Not a Strong number

🧠 Key Learning Point

This program helps you understand:

✔ Digit extraction logic
✔ Factorial calculation
✔ Combining multiple steps in one program
✔ Writing efficient number-based programs

👉 It also builds the ability to decide which loop to use based on the problem requirement.

🎯 Why This Video Is Important

This lesson helps students:

• Strengthen logical thinking
• Combine multiple concepts together
• Solve advanced number-based problems
• Prepare for exams and interviews

#Python #PythonProgrammingNewSeries #BurleSharma
#StrongNumber
#WhileLoopPython
#ForLoopPython
#DigitPrograms
#PythonBeginners
#PythonDryRun
#Geecoding #PythonClass22

Видео 3.22 – Strong Number Program | Python Programming – New Series канала Burle Sharma (geecoding)
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять