Welcome to the Core Python Programming Repository! This repository contains a comprehensive collection of Python programs covering fundamental programming concepts, operators, data types, and basic algorithms. It's designed as a learning resource for beginners to master core Python programming concepts through practical examples.
This repository serves as:
- A learning resource for Python beginners
- A collection of solved programming exercises
- A reference guide for basic Python operations and algorithms
- Practice material for understanding Python fundamentals
Core-Python/
โโโ README.md # Main documentation (this file)
โโโ Operators/ # Programs demonstrating operators and basic concepts
โ โโโ README.md # Detailed problem statements
โ โโโ *.py # Python solution files
โโโ DecisionMaking/ # Programs demonstrating decision-making concepts
โโโ README.md # Detailed problem statements
โโโ *.py # Python solution files
| # | Program Name | File | Description |
|---|---|---|---|
| 1 | First Python Program | FirstPython.py |
Display a simple message |
| 2 | Data Types | Operator.py, dataType.py |
Input and display all basic data types |
| # | Program Name | File | Description |
|---|---|---|---|
| 3 | Arithmetic Operations | ArithmeticOperation.py |
Perform all arithmetic operations on two numbers |
| 4 | Rectangle Area | RectangleArea.py |
Calculate area of a rectangle |
| 5 | Circle Properties | CircleOp.py |
Calculate diameter, area, and circumference of a circle |
| # | Program Name | File | Description |
|---|---|---|---|
| 6 | Length Conversion | Convertion.py |
Convert centimeters to meters and kilometers |
| 7 | Temperature Conversion (F to C) | TemperatureConvertion.py |
Convert Fahrenheit to Celsius |
| 8 | Temperature Conversion (C to F) | TemperatureConvertion.py |
Convert Celsius to Fahrenheit |
| 17 | Time Conversion | TimeConvert.py |
Convert seconds to hours, minutes, and seconds |
| 18 | Day Conversion | ConvertDaytoMonthWeek.py |
Convert days to years, months, and weeks |
| # | Program Name | File | Description |
|---|---|---|---|
| 9 | Triangle Angle | FindThirdAngle.py |
Find the third angle of a triangle |
| 10 | Equilateral Triangle | EquilateralTriangle.py |
Calculate area of an equilateral triangle |
| 11 | Marks Calculator | TotalMarksPerc.py |
Calculate total marks and percentage |
| 12 | Simple Interest | SimpleIntrest.py |
Calculate simple interest |
| 13 | Compound Interest | CompoundIntrest.py |
Calculate compound interest |
| # | Program Name | File | Description |
|---|---|---|---|
| 14 | Swap with Variable | SwappingNumberVar.py |
Swap two numbers using a third variable |
| 15 | Swap without Variable | SwappingWithoutVar.py |
Swap two numbers without using a third variable |
| 16 | ASCII Value | AsciiValue.py |
Print ASCII value of a character |
| 19 | Cube Calculator | DigitCount.py |
Read a number and display its cube |
| 20 | Sum of Digits | DigitCount.py |
Compute the sum of an integer's digits |
| 21 | Reverse Number | ReverseNumber.py |
Reverse a number without using a loop |
| 22 | First & Last Digit | FirstAndLastDigit.py |
Find first and last digit of a number |
| 23 | Sum of First & Last | FirstAndLastDigitSum.py |
Calculate sum of first and last digit |
| # | Program Name | File | Description |
|---|---|---|---|
| 24 | Neon Number | NeonNumber.py |
Check if a number is a Neon number |
| 25 | Palindrome | Palindrome.py |
Check if a number is a palindrome |
| 26 | Spy Number | SpyNumber.py |
Check if a number is a Spy number |
| # | Program Name | File | Description |
|---|---|---|---|
| 27 | Toggle Case | ToggleInput.py |
Toggle case of alphabet using ASCII values |
| 28 | Net Salary | NetSalaryEmployee.py |
Calculate net salary of an employee |
| 29 | Quotient & Remainder | FindQAndR.py |
Find quotient and remainder using arithmetic operators |
| 30 | Multiple Check | MultipleOrNot.py |
Check if number is multiple of both 3 and 5 |
| # | Program Name | File | Description |
|---|---|---|---|
| 31 | Even or Odd | EvenOdd.py |
Check if a number is even or odd |
| 32 | Leap Year | LeapYear.py |
Check if a year is a leap year |
| 33 | Positive or Negative | PosNeg.py |
Determine if a number is positive, negative, or zero |
| 34 | Largest of Three | LargestOfThree.py |
Find the largest of three numbers |
| 35 | Grade Calculator | GradeCalculator.py |
Calculate grade based on marks |
| 36 | Valid Triangle | ValidTriangle.py |
Check whether a triangle is valid or not |
| 37 | Triangle Type | TriangleType.py |
Check if a triangle is equilateral, isosceles, or scalene |
| 38 | Divisibility Check | DivisibilityCheck.py |
Check if a number is divisible by 5 and 11 |
| 39 | Alphabet Check | AlphabetCheck.py |
Check whether a character is alphabetic or not |
| 40 | Profit or Loss | ProfitOrLoss.py |
Check profit or loss based on cost price and selling price |
| 41 | Vowel or Consonant | VowelOrConsonant.py |
Check if an alphabet is a vowel or consonant |
| 42 | Character Type | CharacterType.py |
Check if a character is an alphabet, digit, or special character |
| 43 | Voting Eligibility | VotingEligibility.py |
Determine if a candidate is eligible to vote |
| 44 | Equality Check | EqualityCheck.py |
Check if two integers are equal |
| 45 | Gross Salary | GrossSalary.py |
Calculate gross salary based on basic salary |
- Python 3.x installed on your system
- A text editor or IDE (VS Code, PyCharm, Sublime Text, etc.)
- Basic understanding of programming concepts
-
Clone the repository:
git clone https://github.com/kulkarnishub377/Core-Python.git cd Core-Python -
Verify Python installation:
python --version # or python3 --version
Navigate to the Operators directory and run any Python file:
cd Operators
python FirstPython.pyOr use Python 3 explicitly:
python3 FirstPython.pyExample 1: Running the Circle Properties Program
python CircleOp.pyEnter the radius of circle: 5
The Diameter of circle is: 10.0
Circumference of circle is: 31.400000000000002
Area of circle is: 78.5
Example 2: Running the Spy Number Checker
python SpyNumber.pyEnter the 4 digit number: 1412
The number is Spy
For beginners, we recommend following this learning path:
-
Start with Basics (Programs 1-3)
- First Python Program
- Data Types
- Arithmetic Operations
-
Move to Calculations (Programs 4-13)
- Geometric calculations
- Unit conversions
- Interest calculations
-
Number Manipulation (Programs 14-23)
- Swapping techniques
- Digit operations
- Number reversals
-
Advanced Concepts (Programs 24-30)
- Special number properties
- ASCII operations
- Complex calculations
-
Decision Making (Programs 31-35)
- Even or Odd determination
- Leap year calculation
- Positive/Negative number identification
- Largest of three numbers
- Grade calculation based on marks
- Data Types: int, float, bool, str, chr
- Operators: Arithmetic (+, -, *, /, //, %), Comparison, Logical
- Input/Output: input(), print()
- Type Conversion: int(), float(), str()
- Mathematical Operations: pow(), basic formulas
- Number Manipulation: Extracting digits, reversing numbers
- ASCII Operations: Character manipulation using ASCII values
- Algorithm Basics: Swap techniques, digit operations
- Decision Making: if-else conditions, logical reasoning
Neon Number: A number whose sum of digits of its square equals the number itself.
- Example: 9 โ 9ยฒ = 81 โ 8 + 1 = 9 โ
Spy Number: A number where the sum of all digits equals the product of all digits.
- Example: 1412 โ Sum(1+4+1+2) = 8, Product(1ร4ร1ร2) = 8 โ
Palindrome Number: A number that reads the same forwards and backwards.
- Example: 121, 1331, 12321
Even or Odd: Determines if a number is even (divisible by 2) or odd.
- Example: 4 is even, 7 is odd
Leap Year: A year is a leap year if divisible by 4, but not every year divisible by 100, except if also divisible by 400.
- Example: 2000 and 2020 are leap years, 1900 is not
Positive, Negative, or Zero: Classifies a number as positive (>0), negative (<0), or zero (=0).
- Example: -5 is negative, 3 is positive, 0 is neither
Largest of Three: Finds the largest number among three given numbers.
- Example: Among 3, 7, and 5, the largest is 7
Grade Calculation: Assigns a grade based on marks using if-elif-else conditions.
- Example: 85 marks โ Grade A, 70 marks โ Grade B
Contributions are welcome! If you'd like to contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/new-program) - Add your program with proper documentation
- Commit your changes (
git commit -m 'Add new program') - Push to the branch (
git push origin feature/new-program) - Open a Pull Request
- Follow Python naming conventions (PEP 8)
- Add comments explaining the logic
- Include example input/output in comments
- Test your code before submitting
- Update the README if adding new programs
All programs in this repository follow these conventions:
- Naming: Descriptive variable names (camelCase or snake_case)
- Comments: Triple-quoted docstrings for problem statements
- Input: Clear prompts for user input
- Output: Descriptive output messages
- Structure: Simple, readable code suitable for beginners
- Some programs reference "Java" in comments but are Python implementations
- The
Operators/README.mdfile also references Java instead of Python
- Add more advanced programs (loops, functions, classes)
- Include unit tests for each program
- Add error handling and input validation
- Create separate directories for different topics
- Add more complex algorithms and data structures
This project is available for educational purposes. Feel free to use these programs for learning and teaching Python programming.
Kulkarni Shubham
- GitHub: @kulkarnishub377
If you have questions, suggestions, or found a bug:
- Open an issue on GitHub
- Submit a pull request with improvements
- Star โญ this repository if you find it helpful!
- Thanks to all contributors who help improve this repository
- Inspired by common programming practice problems
- Created as a learning resource for the Python community
Happy Coding! ๐
Last Updated: October 2024