A collection of small command-line Python programs demonstrating input/output, control flow, functions, and basic arithmetic logic. Each script is standalone and runs directly with Python.
Requirements:
- Python 3.x
- No external libraries required (standard library only)
Running a program: python filename.py
Example: python hello.py
Description: A simple interactive program that greets the user and asks basic personal questions.
Concepts: - User input and output - String manipulation - Sequential program flow
Description: A menu-driven calculator performing arithmetic operations with history tracking and average calculation.
Supported operations: - Addition, Subtraction, Multiplication, Division - Exponentiation, Logarithmic calculation
Concepts: - Menu-driven program flow - Floating-point arithmetic - Lists for result tracking - Iterative user interaction
Description: An advanced calculator with scientific functions and enhanced user interaction.
Features: - Arithmetic operations - Exponentiation using previous result - Logarithmic calculations (arbitrary base) - Tracking of results and computing averages - Continuous menu redisplay for repeated operations
Concepts: - Menu-driven flow - Floating-point arithmetic - Lists for storing calculation history - Math library integration
Description: Converts and decodes numeric strings between number representations.
Supports: - Hexadecimal strings (with or without 0x) to decimal - Binary strings to decimal - Binary strings to hexadecimal
Concepts: - Manual base conversion algorithms - String parsing and validation - Modular function design
Description: A command-line Blackjack game with interactive menu and statistics.
Features: - Drawing cards or holding hand - Dealer simulation and outcome comparison - Tracking wins, losses, ties, total games, and win percentage - Menu-driven continuous play - Custom random number generator for card draws
Concepts: - Game logic and conditional flow - Loops for continuous gameplay - State tracking and statistics computation - User input validation and interactive menu design