A curated collection of foundational Python programming concepts, mathematical algorithms, loop logic, and ASCII star/number pattern programs.
-
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.
-
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 uniquefor...elseloop flow. -
15_count_even_odd.py: Continuous dynamic input counter for even and odd integers.
-
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.
24_menu_driven_functions.py: Full interactive console application with reusable math functions and pattern options.
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