This repository contains a collection of basic Python scripts that demonstrate fundamental programming concepts. Each script is a standalone example that can be run and studied individually.
Here is a list of the Python files in this project and a brief description of what they demonstrate:
variables.py: How to declare and use variables of different data types (string, integer, float, boolean).typecasting.py: How to convert variables from one data type to another.input.py: How to take input from the user.operators.py: Different types of operators in Python (arithmetic, assignment, comparison, logical, identity, membership, and ternary).ascii.py: How to get the ASCII value of a character and vice-versa.ifelse.py: Conditional statements usingif,elif, andelse.ternary.py: How to use the ternary operator for concise conditional expressions.forloop.py: How to useforloops to iterate over a sequence.whileloop.py: How to usewhileloops for repeated execution of a block of code.calculator.py: A simple calculator that performs basic arithmetic operations based on user input.pattern.py: How to print different patterns using nested loops.app.py: A simple "Hello World" program.
To run any of the scripts, navigate to the project directory in your terminal and use the python command followed by the script name. For example:
python forloop.py