Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 2.4 KB

File metadata and controls

48 lines (39 loc) · 2.4 KB

🐍 Python Basic Programs & Problem Solving

A curated collection of foundational Python programming concepts, mathematical algorithms, loop logic, and ASCII star/number pattern programs.


📂 Programs Index

🔁 Loop Basics & Arithmetic Logic

  • 01_for_loop_basics.py: Vertical, horizontal, stepped, and reverse iterations.
  • 02_power_calculation.py: Power of $a^b$ calculation using repeated multiplication.
  • 03_hcf_gcd.py: Highest Common Factor (HCF) / Greatest Common Divisor (GCD) using loops.
  • 04_prime_checker.py: Prime number verification.
  • 05_factors_of_number.py: Divisor / factor listing for any integer.
  • 06_factorial.py: Factorial calculation ($n!$).
  • 07_perfect_number.py: Perfect number check ($6 = 1 + 2 + 3$).
  • 08_multiplication_table.py: Clean formatted math multiplication table ($1$ to $10$).
  • 09_sum_of_natural_numbers.py: Sum of first $n$ natural numbers.

🔢 Digit Extraction & While Loops

  • 10_while_loop_sum_of_digits.py: Extract and sum individual digits of a number.
  • 11_sum_of_even_digits.py: Extract and sum only even digits.
  • 12_armstrong_number.py: Armstrong number checker ($153 = 1^3 + 5^3 + 3^3$).
  • 13_reverse_number.py: Reversing digits of an integer ($195 \rightarrow 591$).
  • 14_for_else_loop.py: Demonstration of Python's unique for...else loop flow.
  • 15_count_even_odd.py: Continuous dynamic input counter for even and odd integers.

📐 Star & Number Patterns

  • 16_star_pattern_grid.py: 5x3 repetitive matrix pattern.
  • 17_number_grid_pattern.py: 6x4 range matrix pattern ($7$ to $10$).
  • 18_slant_triangle_pattern.py: Incremental number triangle ($1$ to $5$).
  • 19_inverted_triangle_pattern.py: Decremental inverted number triangle.
  • 20_reverse_number_slant.py: Countdown rows ($5\ 4\ 3\ 2\ 1$).
  • 21_hollow_square_pattern.py: Border numbers with hollow star interior.
  • 22_pyramid_pattern.py: Symmetric centered pyramid.
  • 23_reverse_pyramid_pattern.py: Decreasing reverse countdown pyramid.

⚙️ Modular Functions & Menus

  • 24_menu_driven_functions.py: Full interactive console application with reusable math functions and pattern options.

🚀 How to Run

Navigate to the directory and run any script using Python 3:

cd "c:\py Programs\github\BASIC_PYTHON_CODES"
python 01_for_loop_basics.py