Skip to content

TheNarratorVIMMXX/Python_Basic_Exams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Python Basic Exams Collection

A collection of 4 fundamental Python programming exams that demonstrate core programming concepts including loops, functions, input validation, and data processing. These exams were completed as part of the programming fundamentals course at CBTis No. 128.


๐Ÿ‘จโ€๐ŸŽ“ Student Information

  • Student: Magallanes Lรณpez Carlos Gabriel
  • Email: cgmagallanes23@gmail.com
  • School: Centro de Bachillerato Tecnolรณgico Industrial y de Servicios No. 128
  • Completion Dates: October 22-27, 2025

๐Ÿ“‹ Project Contents

This repository contains 4 progressively challenging Python exams that cover essential programming fundamentals:

๐Ÿ“Œ Exam 1: School Charity Raffle

Date: October 22, 2025

A raffle program that selects a winner from 5 participants based on academic performance and random number matching.

Features:

  • Student eligibility verification (minimum 9.0 GPA)
  • Random number generation and matching
  • Input validation for grades (1-10 range)
  • Lucky number validation (1-10 range)
  • Winner announcement with string concatenation

Concepts Covered:

  • while loops with break statements
  • Random number generation
  • Conditional logic
  • Input validation
  • String formatting with % operator

๐Ÿ“Œ Exam 2: Store Inventory Management

Date: October 23, 2025

An inventory system that tracks 10 products and calculates the average cost per product from supplier.

Features:

  • Product registration (name, public price, supplier cost, quantity)
  • Total acquisition cost calculation
  • Average cost per product computation
  • Input validation for prices and quantities
  • Function with return value

Concepts Covered:

  • for loops
  • Functions with return values
  • Accumulator variables
  • Input validation
  • F-string formatting
  • Rounding decimal numbers

๐Ÿ“Œ Exam 3: Weekly Coffee Shop Sales Control

Date: October 27, 2025

A sales tracking system for a coffee shop that registers daily sales for 7 days and calculates average daily income.

Features:

  • Daily sales registration (coffee and desserts)
  • Quantity and price tracking
  • Total weekly income calculation
  • Average daily income computation
  • Input validation for quantities and minimum prices

Concepts Covered:

  • for loops
  • Functions with return values
  • Multiple data tracking
  • Input validation with specific price ranges
  • .format() string formatting
  • Mathematical calculations

๐Ÿ“Œ Exam 4: Weekly Exercise Tracker

Date: October 27, 2025

A fitness tracking program that records 3 exercise sessions and displays a comprehensive summary.

Features:

  • Exercise session registration (type, duration, calories)
  • Exercise type validation (Cardio/Strength/Resistance)
  • Total minutes and calories tracking
  • Average calories per session calculation
  • Formatted summary display

Concepts Covered:

  • while loops with counters
  • Functions without return (void functions)
  • Multiple conditional validations
  • String validation
  • F-string formatting
  • Statistical calculations

๐ŸŽฏ Learning Objectives

These exams comprehensively cover fundamental Python programming concepts:

  • โœ… Loop Control: while and for loops with proper iteration
  • โœ… Conditional Logic: if-elif-else statements and nested conditions
  • โœ… Input Validation: Comprehensive data verification with error handling
  • โœ… Functions: Both return and void functions
  • โœ… Random Numbers: Using random module for number generation
  • โœ… String Formatting: %, .format(), and f-strings
  • โœ… Mathematical Operations: Averages, totals, and rounding
  • โœ… Accumulator Pattern: Tracking sums and counts
  • โœ… Data Type Conversion: int(), float(), str()
  • โœ… Control Flow: break statements and loop counters

๐Ÿ“ฆ Requirements

Python 3.x
random module (included in standard library)

โ–ถ๏ธ How to Run

  1. Clone this repository:
git clone https://github.com/yourusername/python-basic-exams.git
cd python-basic-exams
  1. Run any exam:
python Ex_1.py  # School Charity Raffle
python Ex_2.py  # Store Inventory Management
python Ex_3.py  # Coffee Shop Sales Control
python Ex_4.py  # Weekly Exercise Tracker

๐Ÿ” Validation Rules

Exam 1 Validations:

  • โœ… Grades: Range 1-10
  • โœ… Lucky number: Range 1-10
  • โœ… GPA requirement: โ‰ฅ 9.0

Exam 2 Validations:

  • โœ… Public price: โ‰ฅ $0.50
  • โœ… Supplier cost: โ‰ฅ $0.50
  • โœ… Product quantity: โ‰ฅ 1

Exam 3 Validations:

  • โœ… Coffee quantity: โ‰ฅ 0
  • โœ… Coffee price: โ‰ฅ $15.00
  • โœ… Dessert quantity: โ‰ฅ 0
  • โœ… Dessert price: โ‰ฅ $25.00

Exam 4 Validations:

  • โœ… Exercise duration: > 0 minutes
  • โœ… Calories burned: > 0
  • โœ… Exercise type: Must be "Cardio", "Fuerza", or "Resistencia"

๐Ÿ“š Learning Outcomes

This collection serves as an educational resource for understanding fundamental Python programming:

๐ŸŽ“ What You'll Learn

  1. Loop Mastery

    • while loops with conditions
    • for loops with range()
    • Loop counters and control variables
    • Breaking out of loops
    • Nested loop structures
  2. Input Validation Techniques

    • Range checking (numeric values)
    • String validation (specific options)
    • Re-prompting on invalid input
    • Error message display
    • Data type conversion safety
  3. Function Design

    • Functions with return values
    • Void functions (procedures)
    • Parameter passing
    • Function documentation
    • Type hints usage
  4. Mathematical Operations

    • Sum accumulation
    • Average calculation
    • Rounding decimals
    • Multiplication and division
    • Percentage calculations
  5. String Formatting

    • Old-style % formatting
    • .format() method
    • F-strings (formatted string literals)
    • Concatenation techniques
    • Output formatting
  6. Control Flow Patterns

    • Conditional execution
    • Multiple conditions (and, or)
    • Nested conditionals
    • Loop exit strategies
    • Program state management
  7. Random Number Generation

    • random.randint() usage
    • Range specification
    • Random selection logic
    • Probability concepts
  8. Data Accumulation

    • Running totals
    • Counter variables
    • Aggregation patterns
    • Statistical calculations
  9. Program Organization

    • Clear documentation
    • Logical flow structure
    • Variable naming conventions
    • Code readability
    • Comment best practices
  10. Error Handling

    • Input validation loops
    • User feedback messages
    • Graceful error recovery
    • Edge case handling

๐ŸŽฏ Skills Developed

By studying and practicing with these exams, you will gain hands-on experience with:

โœ… Iterative programming with loops and counters
โœ… Data validation and input sanitization
โœ… Function decomposition for code reusability
โœ… Mathematical problem-solving in programming
โœ… String manipulation and formatting techniques
โœ… Algorithmic thinking for business logic
โœ… Code documentation and professional standards

This repository is perfect for students learning Python fundamentals, preparing for programming exams, or anyone wanting to understand essential programming patterns through practical exercises.


๐Ÿ“Š Exam Comparison Table

Exam Loop Type Function Type Validation Count Output Format Difficulty
1 - Raffle while + break None 4 validations % operator โญโญ
2 - Inventory for Return value 3 validations F-string โญโญโญ
3 - Coffee Shop for Return value 4 validations .format() โญโญโญ
4 - Exercise while Void function 3 validations F-string โญโญโญโญ

๐Ÿ”ฎ Practice Suggestions

For Beginners:

  1. Start with Exam 1 to understand basic loops and conditionals
  2. Move to Exam 2 to learn functions with return values
  3. Practice Exam 3 to master multiple data tracking
  4. Challenge yourself with Exam 4 for advanced validation

For Intermediate Learners:

  1. Modify the programs to add new features
  2. Combine concepts from multiple exams
  3. Add error handling with try-except
  4. Create GUI versions using Tkinter

Enhancement Ideas:

  • Add data persistence (save to file)
  • Create classes for better organization
  • Implement unit tests
  • Add command-line arguments
  • Create database integration
  • Build GUI interfaces
  • Add data export (CSV, JSON)

๐Ÿ“„ License

This project is educational in nature and available for free use for learning purposes.


๐Ÿค Contributing

Students and educators are welcome to:

  • Report issues or bugs
  • Suggest improvements
  • Share alternative solutions
  • Create additional practice problems
  • Translate to other languages

๐Ÿ“ง Contact

Carlos Gabriel Magallanes Lรณpez
Email: cgmagallanes23@gmail.com
School: CBTis No. 128


โญ If these exams helped you learn Python fundamentals, please give this repository a star!

๐Ÿ“– Happy Learning and Good Luck with Your Studies!

Releases

No releases published

Packages

No packages published

Languages