Welcome to my Python Basics repository! This collection contains fundamental Python concepts and examples that I've learned and practiced. Perfect for beginners looking to understand core Python programming concepts.
This repository covers essential Python topics with practical examples and code demonstrations.
string.py- String operations and methodsstring_slicing.py- String slicing techniquesoperatin_string.py- Advanced string operationsfstring.py- F-string formattingtypecasting.py- Type conversion examples
lists.py- List basics and operationslist_method.py- List methods and functionstuple.py- Tuple fundamentalstuple_method.py- Tuple operationsdictonary.py- Dictionary basicsdictionary_method.py- Dictionary methodssets.py- Set operationsunion_set.py- Set union operationslist_tuple_dic.py- Comparison of data structures
if_else.py- Conditional statementsshort_hand_if -else.py- Ternary operatorsmatch_case.py- Match-case statements (Python 3.10+)loops.py- For and while loopswhile_loop.py- While loop examplesloops_with_else.py- Loop-else constructsbreak_and _continues.py- Break and continue statements
define-functon.py- Function definitionsfun_arguement.py- Function argumentslambda_function.py- Lambda functionslocal_vs_global.py- Variable scoperecursion.py- Recursive functionsdocstring.py- Function documentation
map_filter_reduce.py- Functional programming conceptsis-vs_== operator.py- Identity vs equality operatorsinput_function.py- User input handling
try-except.py- Exception handlingraise *custom *error.py- Custom exceptionsfinally_clause.py- Finally clause usage
project1.py- Practice project 1project1.1.py- Practice project 1.1starpattern.py- Star pattern programsdemo.py- Demonstration codemain.py- Main execution file
-
Clone the repository:
git clone https://github.com/yourusername/python-basics.git cd python-basics -
Run any Python file:
python filename.py
-
Explore and learn:
- Start with basic concepts like
string.pyandif_else.py - Progress to data structures like
lists.pyanddictonary.py - Practice with control flow examples in
loops.py - Challenge yourself with projects and advanced concepts
- Start with basic concepts like
string.py→typecasting.py→input_function.pyif_else.py→loops.py→break_and _continues.pylists.py→tuple.py→dictonary.py
define-functon.py→lambda_function.py→recursion.pytry-except.py→raise *custom *error.pymap_filter_reduce.py→ Advanced projects
- Variables and Data Types
- String Manipulation
- Lists, Tuples, Dictionaries, and Sets
- Conditional Statements
- Loops and Iterations
- Functions and Scope
- Error Handling
- Object-Oriented Programming Basics
- File Operations
- Functional Programming Concepts
- Each file focuses on a specific Python concept
- Code is well-commented for easy understanding
- Examples progress from basic to more complex
- Practice by modifying and running the code
- Use as a reference while learning Python
Feel free to:
- Suggest improvements
- Add more examples
- Fix any issues you find
- Share your own Python learning resources
- All code is written in Python 3.x
- Some files may require specific Python versions (noted in comments)
tempCodeRunnerFile.pyis a temporary file used by code runners
If you have any questions or suggestions, feel free to reach out!
Happy Coding! 🎉
"The best way to learn Python is by practicing. Each file in this repository is a step towards mastering Python programming."