├── .github ├── FUNDING.yml └── workflows │ └── blank.yml ├── 30 Days Essentials ├── Days-1-3.md ├── Days-11-14.md ├── Days-15-18.md ├── Days-19-22.md ├── Days-23-26.md ├── Days-27-30.md ├── Days-4-6.md ├── Days-7-10.md └── Readme.md ├── LICANCE ├── Projects ├── Bank Application.md ├── Dictionary Application.md ├── Notepad Application.md ├── Password Generator.md ├── Readme.md ├── To-Do-List-Application.md ├── Vehicle Rental Application.md └── Weather Application.md ├── Readme.md └── source ├── projects.png └── python-in-30-days.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: HalilDeniz 4 | patreon: denizhalil 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: https://www.buymeacoffee.com/halildeniz 14 | -------------------------------------------------------------------------------- /.github/workflows/blank.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the "main" branch 8 | push: 9 | branches: [ "main" ] 10 | pull_request: 11 | branches: [ "main" ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v3 27 | 28 | # Runs a single command using the runners shell 29 | - name: Run a one-line script 30 | run: echo Hello, world! 31 | 32 | # Runs a set of commands using the runners shell 33 | - name: Run a multi-line script 34 | run: | 35 | echo Add other actions to build, 36 | echo test, and deploy your project. 37 | -------------------------------------------------------------------------------- /30 Days Essentials/Days-1-3.md: -------------------------------------------------------------------------------- 1 | ### **Day 1: Introduction to Python** 2 | - Python is a high-level, interpreted programming language known for its readability and simplicity. 3 | - It is versatile and widely used in various domains, including web development, data analysis, artificial intelligence, and more. 4 | - Python code is executed line by line, making it an excellent choice for beginners. 5 | - Example: 6 | 7 | ```python 8 | # This is a simple Python program that prints a message 9 | print("Hello, World!") 10 | ``` 11 | 12 | ### **Day 2: Variables and Data Types** 13 | - Variables are used to store and manipulate data in Python. 14 | - Python supports various data types, including: 15 | - Strings (text): `name = "John"` 16 | - Integers (whole numbers): `age = 30` 17 | - Floats (decimal numbers): `height = 6.1` 18 | - Lists (ordered collections of items): `fruits = ["apple", "banana", "cherry"]` 19 | - Tuples (immutable, ordered collections): `point = (3, 4)` 20 | - Dictionaries (key-value pairs): `person = {"name": "Alice", "age": 25}` 21 | - Variables are dynamically typed, meaning their data type can change during runtime. 22 | - Example: 23 | 24 | ```python 25 | name = "John" 26 | age = 30 27 | height = 6.1 28 | fruits = ["apple", "banana", "cherry"] 29 | person = {"name": "Alice", "age": 25} 30 | ``` 31 | 32 | ### **Day 3: Conditional Statements and Loops** 33 | - Conditional statements allow your code to make decisions based on conditions. 34 | - Common conditional statements include `if`, `elif` (else if), and `else`. 35 | - Loops, such as `for` and `while`, are used for repetitive tasks. 36 | 37 | **Conditional Statements:** 38 | ```python 39 | x = 10 40 | if x > 5: 41 | print("x is greater than 5") 42 | elif x == 5: 43 | print("x is equal to 5") 44 | else: 45 | print("x is less than 5") 46 | ``` 47 | 48 | **For Loop:** 49 | - For loops are used to iterate over a sequence (e.g., a list or string). 50 | - Example: 51 | 52 | ```python 53 | fruits = ["apple", "banana", "cherry"] 54 | for fruit in fruits: 55 | print("I love " + fruit) 56 | ``` 57 | 58 | **While Loop:** 59 | - While loops continue executing as long as a specified condition is True. 60 | - Example: 61 | 62 | ```python 63 | count = 0 64 | while count < 5: 65 | print("Count: " + str(count)) 66 | count += 1 67 | ``` 68 | 69 | These examples provide a deeper understanding of Python's core concepts. Make sure to run them in a Python environment to see the results. You can install Python by downloading it from the official Python website [**python.org**](https://www.python.org/downloads/). After installation, you can use a code editor or Python's built-in IDLE to write and run Python code. 70 | 71 | These foundational concepts will serve as the building blocks for your Python journey. Continue to explore and experiment with Python to solidify your understanding and become a proficient Python programmer. -------------------------------------------------------------------------------- /30 Days Essentials/Days-11-14.md: -------------------------------------------------------------------------------- 1 | ### **Day 11: Functions** 2 | Functions are essential building blocks in Python that encapsulate a set of instructions. 3 | 4 | - **Function Basics:** 5 | - Functions are reusable blocks of code that perform a specific task. 6 | - You can define your own functions in Python. 7 | - **Function Definition and Calling:** 8 | - Define functions using the `def` keyword, and call them with arguments. 9 | - Example: 10 | 11 | ```python 12 | def greet(name): 13 | print(f"Hello, {name}!") 14 | 15 | greet("Alice") # Call the greet function with the argument "Alice." 16 | ``` 17 | 18 | - **Function Parameters:** 19 | - Functions can accept parameters (inputs) to perform actions on. 20 | - Parameters are defined within parentheses in the function definition. 21 | - **Function Invocation:** 22 | - When a function is called, it executes the code within its block and may return a result. 23 | 24 | ### **Day 12: Function Parameters and Return Values** 25 | Functions can take parameters (inputs) and return values (outputs). 26 | 27 | - **Parameters:** 28 | - Parameters allow you to pass data into a function. 29 | - Functions can accept multiple parameters. 30 | - Example: 31 | 32 | ```python 33 | def add(x, y): 34 | result = x + y 35 | return result 36 | 37 | sum_result = add(3, 5) 38 | print(sum_result) # Prints the result of the add function, which is 8. 39 | ``` 40 | 41 | - **Return Values:** 42 | - The `return` statement is used to send a result back from a function. 43 | - Functions can return values of various data types. 44 | 45 | ### **Day 13: Built-in Modules** 46 | Python provides built-in modules that offer additional functionality. 47 | 48 | - **Importing Modules:** 49 | - You can use the `import` statement to access built-in modules. 50 | - Modules extend Python's capabilities for various purposes. 51 | - Example: 52 | 53 | ```python 54 | import math 55 | 56 | sqrt_result = math.sqrt(25) # Calculate the square root of 25. 57 | print(sqrt_result) # Prints the result, which is 5.0. 58 | ``` 59 | 60 | - **Common Built-in Modules:** 61 | - Python has a wide range of built-in modules, including `math`, `random`, `datetime`, and `os`, among others. 62 | - These modules provide functions and classes to solve common programming problems. 63 | 64 | ### **Day 14: Creating Your Own Modules** 65 | You can create your own Python modules to organize and reuse your code. 66 | 67 | - **Module Basics:** 68 | - A module is a Python file containing functions, variables, and classes. 69 | - It allows you to organize and encapsulate related code. 70 | - **Creating a Custom Module:** 71 | - You can create your own modules by defining functions and variables in a Python file. 72 | - Example: 73 | 74 | ```python 75 | # my_module.py 76 | def greet(name): 77 | print(f"Hello, {name}!") 78 | 79 | # wifi-app.py 80 | import my_module 81 | 82 | my_module.greet("Bob") # Call the greet function from the custom module. 83 | ``` 84 | 85 | - **Module Reusability:** 86 | - Modules promote code reusability and maintainability. 87 | - You can use modules across multiple Python scripts to share functionality. 88 | 89 | Understanding functions and modules is essential for writing organized, reusable, and efficient code in Python. By mastering these concepts, you can efficiently structure your programs and make them more maintainable. Practice with these examples to become proficient in using functions and modules in your Python projects. -------------------------------------------------------------------------------- /30 Days Essentials/Days-15-18.md: -------------------------------------------------------------------------------- 1 | ### **Day 15: File Handling** 2 | File handling in Python is essential for reading from and writing to files. 3 | 4 | - **Opening a File:** 5 | - Use the `open()` function to interact with files, specifying the file name and the mode ("r" for read, "w" for write, "a" for append, etc.). 6 | - **Reading from a File:** 7 | - To read the contents of a file, use the `read()` method on the file object. 8 | - **Writing to a File:** 9 | - To write content to a file, use the `write()` method on the file object. 10 | 11 | **Example of reading from a file:** 12 | ```python 13 | # Open a file for reading 14 | file = open("example.txt", "r") 15 | 16 | # Read the contents of the file 17 | content = file.read() 18 | print(content) 19 | 20 | # Close the file 21 | file.close() 22 | ``` 23 | 24 | **Example of writing to a file:** 25 | ```python 26 | # Open a file for writing 27 | file = open("example.txt", "w") 28 | 29 | # Write content to the file 30 | file.write("Hello, Python!") 31 | 32 | # Close the file 33 | file.close() 34 | ``` 35 | 36 | ### **Day 16: File Modes and Context Managers** 37 | Understanding file modes and using context managers (with statement) can simplify file handling. 38 | 39 | - **File Modes:** 40 | - File modes, such as "r" (read), "w" (write), and "a" (append), determine how the file is opened. 41 | - **Context Managers:** 42 | - Context managers ensure that files are automatically closed, even if an exception occurs. 43 | 44 | **Example of using a context manager to read a file:** 45 | ```python 46 | # Using a context manager to automatically close the file 47 | with open("example.txt", "r") as file: 48 | content = file.read() 49 | print(content) 50 | ``` 51 | 52 | ### **Day 17: Error Handling (Try-Except Blocks)** 53 | Error handling allows you to gracefully handle exceptions and errors in your code. 54 | 55 | - **Try-Except Blocks:** 56 | - Use `try` and `except` blocks to catch and handle exceptions. 57 | - **Exception Types:** 58 | - Python has many built-in exception types, and you can create custom exceptions. 59 | 60 | **Example of handling an exception:** 61 | ```python 62 | try: 63 | num = int("abc") # This will raise a ValueError 64 | except ValueError as e: 65 | print(f"An error occurred: {e}") 66 | ``` 67 | 68 | ### **Day 18: Error Handling (Multiple Exceptions and Custom Exceptions)** 69 | Handling multiple exceptions and creating custom exceptions enhance your error-handling capabilities. 70 | 71 | - **Handling Multiple Exceptions:** 72 | - You can use multiple `except` blocks to handle different exception types. 73 | - **Custom Exceptions:** 74 | - Create custom exception classes by defining new exception types. 75 | 76 | **Example of handling multiple exceptions and creating a custom exception:** 77 | ```python 78 | try: 79 | result = 10 / 0 # This will raise a ZeroDivisionError 80 | except ZeroDivisionError as e: 81 | print(f"Division by zero error: {e}") 82 | except Exception as e: 83 | print(f"An unexpected error occurred: {e}") 84 | 85 | # Custom exception 86 | class MyCustomError(Exception): 87 | pass 88 | 89 | try: 90 | raise MyCustomError("This is a custom error.") 91 | except MyCustomError as e: 92 | print(f"Custom error caught: {e}") 93 | ``` 94 | 95 | Mastering file handling and error handling is crucial for writing robust and reliable Python programs. These skills enable you to work with files effectively and gracefully manage errors that may occur during program execution. Practice with these examples to become proficient in file handling and error handling in Python. -------------------------------------------------------------------------------- /30 Days Essentials/Days-19-22.md: -------------------------------------------------------------------------------- 1 | ### **Day 19: Introduction to Object-Oriented Programming (OOP)** 2 | Object-Oriented Programming is a programming paradigm that uses objects to represent real-world entities. 3 | 4 | - **Classes and Objects:** 5 | - Classes define blueprints for creating objects. 6 | - Objects are instances of classes. 7 | - **Attributes and Methods:** 8 | - Classes can have attributes (data) and methods (functions) that define their properties and behavior. 9 | 10 | **Example of creating a simple class and an object:** 11 | ```python 12 | # Define a simple class 13 | class Dog: 14 | def __init__(self, name): 15 | self.name = name 16 | 17 | def bark(self): 18 | print(f"{self.name} says woof!") 19 | 20 | # Create an object (instance) of the Dog class 21 | my_dog = Dog("Buddy") 22 | my_dog.bark() # Call the bark method on the object 23 | ``` 24 | 25 | ### **Day 20: Class Attributes and Methods** 26 | Classes can have attributes and methods that define their behavior. 27 | 28 | - **Class Attributes:** 29 | - Class attributes are shared among all instances of the class. 30 | - **Instance Attributes:** 31 | - Instance attributes are specific to individual objects. 32 | - **Methods:** 33 | - Methods are functions defined within a class. 34 | 35 | **Example of class attributes and methods:** 36 | ```python 37 | class Circle: 38 | def __init__(self, radius): 39 | self.radius = radius 40 | 41 | def area(self): 42 | return 3.14159 * self.radius**2 43 | 44 | def circumference(self): 45 | return 2 * 3.14159 * self.radius 46 | 47 | my_circle = Circle(5) 48 | print(f"Area: {my_circle.area()}") 49 | print(f"Circumference: {my_circle.circumference()}") 50 | ``` 51 | 52 | ### **Day 21: Inheritance** 53 | Inheritance allows you to create new classes that inherit attributes and methods from existing classes. 54 | 55 | - **Parent Class (Superclass):** 56 | - The parent class defines common attributes and methods. 57 | - **Child Class (Subclass):** 58 | - The child class inherits from the parent class and can have additional attributes and methods. 59 | 60 | **Example of inheritance:** 61 | ```python 62 | # Parent class 63 | class Animal: 64 | def __init__(self, name): 65 | self.name = name 66 | 67 | def speak(self): 68 | pass 69 | 70 | # Child class inheriting from Animal 71 | class Dog(Animal): 72 | def speak(self): 73 | return f"{self.name} says woof!" 74 | 75 | my_dog = Dog("Buddy") 76 | print(my_dog.speak()) # Calls the speak method of the Dog class 77 | ``` 78 | 79 | ### **Day 22: Polymorphism** 80 | Polymorphism allows objects of different classes to be treated as objects of a common superclass. 81 | 82 | - **Common Superclass:** 83 | - Create a common superclass that defines shared methods or attributes. 84 | - **Subclasses with Different Implementations:** 85 | - Subclasses provide their own implementations of methods. 86 | 87 | **Example of polymorphism:** 88 | ```python 89 | # Common superclass 90 | class Shape: 91 | def area(self): 92 | pass 93 | 94 | # Subclasses with different implementations of area 95 | class Circle(Shape): 96 | def __init__(self, radius): 97 | self.radius = radius 98 | 99 | def area(self): 100 | return 3.14159 * self.radius**2 101 | 102 | class Rectangle(Shape): 103 | def __init__(self, width, height): 104 | self.width = width 105 | self.height = height 106 | 107 | def area(self): 108 | return self.width * self.height 109 | 110 | shapes = [Circle(5), Rectangle(4, 6)] 111 | 112 | for shape in shapes: 113 | print(f"Area: {shape.area()}") 114 | ``` 115 | 116 | Object-Oriented Programming (OOP) is a fundamental concept in Python and many other programming languages. It allows you to model real-world entities, promote code organization, and enhance code reusability. Practice with these examples to become proficient in using OOP principles in Python. -------------------------------------------------------------------------------- /30 Days Essentials/Days-23-26.md: -------------------------------------------------------------------------------- 1 | ### **Day 23: Database Connection** 2 | Python can connect to various types of databases using different database libraries. One common library for working with databases in Python is `sqlite3` for SQLite databases. 3 | 4 | - **Connecting to a Database:** 5 | - Use the `sqlite3.connect()` method to connect to a database. 6 | - This method creates a new database if it doesn't exist or opens an existing one. 7 | 8 | **Example of connecting to an SQLite database:** 9 | ```python 10 | import sqlite3 11 | 12 | # Connect to a database (creates a new one if it doesn't exist) 13 | conn = sqlite3.connect("my_database.db") 14 | 15 | # Create a cursor object to execute SQL commands 16 | cursor = conn.cursor() 17 | 18 | # Close the connection when done 19 | conn.close() 20 | ``` 21 | 22 | ### **Day 24: Creating Tables and Inserting Data** 23 | You can create tables in a database and insert data into them using SQL commands. 24 | 25 | - **Creating Tables:** 26 | - Use the `execute()` method to run SQL CREATE TABLE queries. 27 | - **Inserting Data:** 28 | - Use the `execute()` method to run SQL INSERT queries. 29 | 30 | **Example of creating a table and inserting data:** 31 | ```python 32 | import sqlite3 33 | 34 | conn = sqlite3.connect("my_database.db") 35 | cursor = conn.cursor() 36 | 37 | # Create a table 38 | cursor.execute(""" 39 | CREATE TABLE IF NOT EXISTS students ( 40 | id INTEGER PRIMARY KEY, 41 | name TEXT, 42 | age INTEGER 43 | ) 44 | """) 45 | 46 | # Insert data into the table 47 | cursor.execute("INSERT INTO students (name, age) VALUES (?, ?)", ("Alice", 25)) 48 | cursor.execute("INSERT INTO students (name, age) VALUES (?, ?)", ("Bob", 30)) 49 | 50 | # Commit the changes and close the connection 51 | conn.commit() 52 | conn.close() 53 | ``` 54 | 55 | ### **Day 25: Querying Data** 56 | You can retrieve data from a database table using SQL SELECT queries. 57 | 58 | - **Querying Data:** 59 | - Use the `execute()` method to run SQL SELECT queries. 60 | - Use the `fetchall()` method to retrieve all rows from a query. 61 | 62 | **Example of querying data from a table:** 63 | ```python 64 | import sqlite3 65 | 66 | conn = sqlite3.connect("my_database.db") 67 | cursor = conn.cursor() 68 | 69 | # Query data from the table 70 | cursor.execute("SELECT * FROM students") 71 | students = cursor.fetchall() 72 | 73 | # Print the results 74 | for student in students: 75 | print(f"ID: {student[0]}, Name: {student[1]}, Age: {student[2]}") 76 | 77 | conn.close() 78 | ``` 79 | 80 | ### **Day 26: Updating and Deleting Data** 81 | You can use SQL UPDATE and DELETE queries to modify or remove data from a database table. 82 | 83 | - **Updating Data:** 84 | - Use SQL UPDATE queries to modify existing data. 85 | - **Deleting Data:** 86 | - Use SQL DELETE queries to remove data from the table. 87 | 88 | **Example of updating and deleting data:** 89 | ```python 90 | import sqlite3 91 | 92 | conn = sqlite3.connect("my_database.db") 93 | cursor = conn.cursor() 94 | 95 | # Update data 96 | cursor.execute("UPDATE students SET age = 26 WHERE name = 'Alice'") 97 | 98 | # Delete data 99 | cursor.execute("DELETE FROM students WHERE name = 'Bob'") 100 | 101 | # Commit the changes and close the connection 102 | conn.commit() 103 | conn.close() 104 | ``` 105 | 106 | Understanding how to work with databases and SQL in Python is crucial for many real-world applications where data storage and retrieval are required. The `sqlite3` library is suitable for learning and small-scale projects, but for larger databases, you may consider other database systems like MySQL or PostgreSQL. Practice with these examples to become proficient in database operations in Python. -------------------------------------------------------------------------------- /30 Days Essentials/Days-27-30.md: -------------------------------------------------------------------------------- 1 | ### **Day 27: Introduction to Web Development** 2 | Web development involves creating websites and web applications. Python can be used for web development with the help of web frameworks like Flask or Django. 3 | 4 | - **Understanding Web Development:** 5 | - Web development involves designing and building websites or web applications that are accessible through web browsers. 6 | - It encompasses both the front-end (user interface) and back-end (server-side) development. 7 | 8 | ### **Day 28: Flask - Creating a Basic Web Application** 9 | Flask is a lightweight web framework for Python. You can create a basic web application with Flask. 10 | 11 | - **Getting Started with Flask:** 12 | - Install Flask using `pip install flask`. 13 | - Create a Flask application and define routes. 14 | - Use decorators like `@app.route('/')` to map URLs to view functions. 15 | - Start the development server using `app.run()`. 16 | 17 | **Example of a basic Flask web application:** 18 | ```python 19 | from flask import Flask 20 | 21 | app = Flask(__name__) 22 | 23 | @app.route('/') 24 | def hello_world(): 25 | return 'Hello, World!' 26 | 27 | if __name__ == '__main__': 28 | app.run() 29 | ``` 30 | 31 | ### **Day 29: Flask - Adding Routes and Templates** 32 | Flask uses routes to map URLs to view functions. You can use templates to generate dynamic HTML content. 33 | 34 | - **Adding Routes and Templates:** 35 | - Define multiple routes for different URLs. 36 | - Use the `render_template` function to render HTML templates. 37 | - Pass data from the view function to the template. 38 | 39 | **Example of adding routes and using templates in Flask:** 40 | ```python 41 | from flask import Flask, render_template 42 | 43 | app = Flask(__name__) 44 | 45 | @app.route('/') 46 | def index(): 47 | return 'Home Page' 48 | 49 | @app.route('/about') 50 | def about(): 51 | return 'About Us' 52 | 53 | @app.route('/contact') 54 | def contact(): 55 | return 'Contact Us' 56 | 57 | @app.route('/profile/') 58 | def profile(username): 59 | return render_template('profile.html', username=username) 60 | 61 | if __name__ == '__main__': 62 | app.run() 63 | ``` 64 | 65 | ### **Day 30: Flask - Handling Forms and Data** 66 | Web applications often require handling user input through forms. You can use Flask to create forms and handle form data. 67 | 68 | - **Handling Forms in Flask:** 69 | - Create HTML forms with input fields. 70 | - Use the `request` object in Flask to access form data. 71 | - Handle form submissions and process user input. 72 | 73 | **Example of handling forms in Flask:** 74 | ```python 75 | from flask import Flask, render_template, request 76 | 77 | app = Flask(__name__) 78 | 79 | @app.route('/') 80 | def index(): 81 | return render_template('index.html') 82 | 83 | @app.route('/submit', methods=['POST']) 84 | def submit(): 85 | if request.method == 'POST': 86 | name = request.form['name'] 87 | email = request.form['email'] 88 | return f'Thank you, {name}, for submitting your email: {email}' 89 | 90 | if __name__ == '__main__': 91 | app.run() 92 | ``` 93 | 94 | Web development is a vast field, and Flask is an excellent starting point for building web applications with Python. However, for more extensive and feature-rich applications, you may consider learning Django, another popular Python web framework. These examples provide a foundation for creating web applications and handling user interactions using Flask. You can continue to explore and expand your web development skills from here. -------------------------------------------------------------------------------- /30 Days Essentials/Days-4-6.md: -------------------------------------------------------------------------------- 1 | ### **Day 4: Conditional Statements** 2 | Conditional statements are crucial for decision-making in your code. 3 | 4 | **`if` Statement:** 5 | - The `if` statement allows you to execute a block of code if a condition is True. 6 | - Example: 7 | 8 | ```python 9 | age = 18 10 | if age >= 18: 11 | print("You are an adult.") 12 | else: 13 | print("You are not an adult.") 14 | ``` 15 | 16 | **`elif` (else if) Statement:** 17 | - The `elif` statement is used for multiple conditions within the same block of code. 18 | - Example: 19 | 20 | ```python 21 | grade = 75 22 | if grade >= 90: 23 | print("A") 24 | elif grade >= 80: 25 | print("B") 26 | elif grade >= 70: 27 | print("C") 28 | else: 29 | print("Fail") 30 | ``` 31 | 32 | ### **Day 5: Loops** 33 | Loops are essential for performing repetitive tasks in your code. 34 | 35 | **`for` Loop:** 36 | - The `for` loop is used to iterate over a sequence, such as a list, and execute a block of code for each item. 37 | - Example: 38 | 39 | ```python 40 | fruits = ["apple", "banana", "cherry"] 41 | for fruit in fruits: 42 | print(fruit) 43 | ``` 44 | 45 | **`while` Loop:** 46 | - The `while` loop continues executing as long as a specified condition is True. 47 | - Example: 48 | 49 | ```python 50 | count = 0 51 | while count < 5: 52 | print(count) 53 | count += 1 54 | ``` 55 | 56 | ### **Day 6: More on Loops** 57 | You can use loops for various tasks and fine-tune their behavior. 58 | 59 | **Looping Through a Range:** 60 | - The `range()` function generates a sequence of numbers that can be used in loops. 61 | - Example: 62 | 63 | ```python 64 | for i in range(5): # This will loop from 0 to 4. 65 | print(i) 66 | ``` 67 | 68 | **Using `break` and `continue` Statements:** 69 | - The `break` statement exits a loop prematurely when a certain condition is met. 70 | - The `continue` statement skips the current iteration and moves to the next one. 71 | - Example: 72 | 73 | ```python 74 | for i in range(10): 75 | if i == 3: 76 | continue # Skip iteration when i equals 3. 77 | if i == 8: 78 | break # Exit the loop when i equals 8. 79 | print(i) 80 | ``` 81 | 82 | Conditional statements and loops are fundamental constructs in Python programming. They provide you with the tools to control the flow of your program and efficiently handle repetitive tasks. Practicing with these examples will help you become more proficient in using them in your Python code. -------------------------------------------------------------------------------- /30 Days Essentials/Days-7-10.md: -------------------------------------------------------------------------------- 1 | ### **Day 7: Lists** 2 | Lists are versatile and commonly used data structures in Python. 3 | 4 | - **List Basics:** 5 | - Lists are ordered collections of items. 6 | - They can contain elements of different data types. 7 | - **Accessing List Elements:** 8 | - You can access elements in a list by their index, starting from 0. 9 | - Example: 10 | 11 | ```python 12 | fruits = ["apple", "banana", "cherry"] 13 | print(fruits[0]) # Access the first item ("apple"). 14 | print(fruits[1]) # Access the second item ("banana"). 15 | ``` 16 | 17 | - **List Methods:** 18 | - Lists have various built-in methods, such as `append()`, `insert()`, `remove()`, and `pop()`, to manipulate their contents. 19 | 20 | ### **Day 8: Tuples** 21 | Tuples are similar to lists, but they have unique characteristics. 22 | 23 | - **Tuple Basics:** 24 | - Tuples are also ordered collections of elements. 25 | - They are immutable, meaning their contents cannot be changed after creation. 26 | - **Accessing Tuple Elements:** 27 | - You can access elements in a tuple using indexing, just like lists. 28 | - Example: 29 | 30 | ```python 31 | coordinates = (3, 4) 32 | print(coordinates[0]) # Access the first element (3). 33 | print(coordinates[1]) # Access the second element (4). 34 | ``` 35 | 36 | - **Use Cases:** 37 | - Tuples are often used for collections of related values, such as coordinates or date and time components. 38 | 39 | ### **Day 9: Dictionaries** 40 | Dictionaries are powerful data structures for organizing data. 41 | 42 | - **Dictionary Basics:** 43 | - Dictionaries consist of key-value pairs. 44 | - They are unordered, and keys must be unique. 45 | - **Accessing Dictionary Values:** 46 | - You can access values in a dictionary using their keys. 47 | - Example: 48 | 49 | ```python 50 | person = { 51 | "name": "Alice", 52 | "age": 25, 53 | "city": "New York" 54 | } 55 | print(person["name"]) # Access the value associated with the "name" key. 56 | print(person["age"]) # Access the value associated with the "age" key. 57 | ``` 58 | 59 | - **Dictionary Methods:** 60 | - Dictionaries offer methods like `keys()`, `values()`, and `items()` to work with their keys and values. 61 | 62 | ### **Day 10: More on Data Structures** 63 | Learn advanced techniques for manipulating data structures. 64 | 65 | - **List Manipulation:** 66 | - You can add, remove, and modify elements in lists. 67 | - Example: 68 | 69 | ```python 70 | fruits = ["apple", "banana", "cherry"] 71 | fruits.append("orange") # Add an element to the end of the list. 72 | fruits.remove("banana") # Remove a specific element from the list. 73 | fruits[0] = "kiwi" # Modify an element in the list. 74 | ``` 75 | 76 | - **Dictionary Manipulation:** 77 | - Dictionaries can be extended, updated, and modified. 78 | - Example: 79 | 80 | ```python 81 | person = {"name": "Alice", "age": 25, "city": "New York"} 82 | person["country"] = "USA" # Add a new key-value pair to the dictionary. 83 | del person["city"] # Remove a key-value pair from the dictionary. 84 | person["age"] = 26 # Modify the value associated with the "age" key. 85 | ``` 86 | 87 | Understanding and effectively using data structures like lists, tuples, and dictionaries is crucial in Python programming. Practice with these examples to gain confidence in managing and organizing data in your Python code. -------------------------------------------------------------------------------- /30 Days Essentials/Readme.md: -------------------------------------------------------------------------------- 1 | # 📚 30 Day Python Essentials 2 | 3 | Welcome to the **30 Day Python Essentials** section of the Python Learning Roadmap! This series of lessons is designed to provide you with a solid foundation in Python programming. Each day focuses on specific topics and provides practical examples and exercises to reinforce your learning. 4 | 5 | ## 📋 Course Content 6 | 7 | ### [Day 1-3](Days-1-3.md): Basic Concepts and Installation 8 | - Understand Python's introduction and why it's popular. 9 | - Learn the basic syntax of Python and its core data types (string, integer, float, list, tuple, dictionary). 10 | - Install Python on your computer. 11 | 12 | ### [Day 4-6](Days-4-6.md): Conditional Statements and Loops 13 | - Master conditional statements (if, elif, else) and logical operators. 14 | - Gain proficiency in using loops (for and while). 15 | 16 | ### [Day 7-10](Days-7-10.md): Data Structures 17 | - Deepen your knowledge of data structures like lists, tuples, and dictionaries. 18 | - Practice working with data structures through hands-on exercises. 19 | 20 | ### [Day 11-14](Days-11-14.md): Functions and Modules 21 | - Define and utilize functions in Python. 22 | - Explore basic Python modules (math, random, datetime). 23 | 24 | ### [Day 15-18](Days-15-18.md): File Handling and Error Handling 25 | - Learn the art of file reading and writing. 26 | - Master error handling techniques using try-except blocks. 27 | 28 | ### [Day 19-22](Days-19-22.md): Object-Oriented Programming (OOP) 29 | - Understand classes and objects. 30 | - Dive into OOP concepts, including inheritance and polymorphism. 31 | 32 | ### [Day 23-26](Days-23-26.md): Database Connection and SQL 33 | - Establish connections with databases (e.g., SQLite). 34 | - Learn to execute basic SQL queries for data manipulation. 35 | 36 | ### [Day 27-30](Days-27-30.md): Web Development and Frameworks 37 | - Explore Python web frameworks like Flask and Django. 38 | - Create a simple web application and gain insights into web development. 39 | 40 | This 30-day series is designed to provide you with essential Python programming skills. By dedicating time each day to follow along and complete the exercises, you'll gradually build your Python proficiency and gain confidence in your programming skills. 41 | 42 | Feel free to reach out if you have any questions or need assistance along the way. Happy learning! 43 | -------------------------------------------------------------------------------- /LICANCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Halil Ibrahim Deniz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Projects/Bank Application.md: -------------------------------------------------------------------------------- 1 | # **Bank Application** 2 | 3 | The "Bank Application" is a Python program that simulates basic banking operations. It allows users to create accounts, log in, check balances, deposit and withdraw money, and transfer funds to other accounts. This project is designed to help you practice your Python programming skills, database management, and basic security measures. 4 | 5 | ### Key Features: 6 | 7 | 1. **Create Account:** Users can create a new bank account by providing a unique username and password. Passwords are securely hashed using the SHA-256 algorithm before storage. 8 | 2. **Login:** Account holders can log in with their usernames and passwords to access their accounts. 9 | 3. **Check Balance:** Users can check their account balances. 10 | 4. **Deposit:** Account holders can deposit money into their accounts. 11 | 5. **Withdraw:** Users can withdraw money from their accounts, provided they have sufficient funds. 12 | 6. **Transfer:** Account holders can transfer money to other accounts, ensuring secure fund transfer. 13 | 14 | ### Project Structure: 15 | 16 | - The program uses an SQLite database to store account information, including usernames, hashed passwords, and account balances. 17 | - User passwords are securely hashed using the SHA-256 algorithm before storage to enhance security. 18 | - It includes a `BankApp` class that encapsulates the functionality of the application, making it organized and easy to maintain. 19 | 20 | ### How to Use: 21 | 22 | 1. Run the Python program. 23 | 2. Select from the available options to create an account, log in, and perform banking operations. 24 | 25 | ### Why This Project? 26 | 27 | This project serves as a practical exercise for intermediate Python programmers. It covers fundamental concepts such as working with databases, user authentication, and class-based application structure. By completing this project, you will improve your Python skills and gain experience in building secure applications. 28 | 29 | ### Suggested Enhancements: 30 | 31 | To further expand and enhance this project, you can consider adding features like: 32 | 33 | - User account management: Allow users to change passwords and update account information. 34 | - Transaction history: Keep a record of all transactions for each account. 35 | - Error handling: Implement robust error handling and validation to enhance security. 36 | 37 | Feel free to explore and customize this project to suit your learning goals and interests. Happy coding! 38 | 39 | ```python 40 | import sqlite3 41 | import hashlib 42 | 43 | 44 | class BankApp: 45 | def __init__(self, db_name): 46 | self.conn = sqlite3.connect(db_name) 47 | self.cursor = self.conn.cursor() 48 | self.create_table() 49 | 50 | def create_table(self): 51 | self.cursor.execute(''' 52 | CREATE TABLE IF NOT EXISTS accounts ( 53 | id INTEGER PRIMARY KEY, 54 | username TEXT, 55 | password TEXT, 56 | balance REAL 57 | ) 58 | ''') 59 | self.conn.commit() 60 | 61 | def user_already_exist(self): 62 | username = input("Enter a username: ") 63 | self.cursor.execute("SELECT username FROM accounts WHERE username = ?", (username)) 64 | account = self.cursor.fetchone() 65 | if account: 66 | print("Username already in use, use another new one") 67 | self.user_already_exist() 68 | else : 69 | return username 70 | 71 | def create_account(self,username,password): 72 | 73 | hashed_password = hashlib.sha256(password.encode()).hexdigest() 74 | self.cursor.execute("INSERT INTO accounts (username, password, balance) VALUES (?,?,?)",(username,hashed_password,0.0)) 75 | self.conn.commit() 76 | print("Account created successfully.") 77 | 78 | def login(self, username, password): 79 | hashed_password = hashlib.sha256(password.encode()).hexdigest() 80 | self.cursor.execute("SELECT * FROM accounts WHERE username=? AND password=?", (username, hashed_password)) 81 | account = self.cursor.fetchone() 82 | return account 83 | 84 | def check_balance(self, username): 85 | self.cursor.execute("SELECT balance FROM accounts WHERE username=?", (username,)) 86 | balance = self.cursor.fetchone() 87 | return balance[0] 88 | 89 | def deposit(self, username, amount): 90 | current_balance = self.check_balance(username) 91 | new_balance = current_balance + amount 92 | self.cursor.execute("UPDATE accounts SET balance=? WHERE username=?", (new_balance, username)) 93 | self.conn.commit() 94 | 95 | def withdraw(self, username, amount): 96 | current_balance = self.check_balance(username) 97 | if amount > current_balance: 98 | return "Insufficient balance" 99 | new_balance = current_balance - amount 100 | self.cursor.execute("UPDATE accounts SET balance=? WHERE username=?", (new_balance, username)) 101 | self.conn.commit() 102 | 103 | def transfer(self, sender_username, receiver_username, amount): 104 | sender_balance = self.check_balance(sender_username) 105 | if amount > sender_balance: 106 | return "Insufficient balance" 107 | 108 | receiver_balance = self.check_balance(receiver_username) 109 | 110 | new_sender_balance = sender_balance - amount 111 | new_receiver_balance = receiver_balance + amount 112 | 113 | self.cursor.execute("UPDATE accounts SET balance=? WHERE username=?", (new_sender_balance, sender_username)) 114 | self.cursor.execute("UPDATE accounts SET balance=? WHERE username=?", (new_receiver_balance, receiver_username)) 115 | self.conn.commit() 116 | 117 | def close(self): 118 | self.conn.close() 119 | 120 | 121 | def main(): 122 | bank_app = BankApp("bank.db") 123 | 124 | while True: 125 | print("\nBank Application.md") 126 | print("1. Create Account") 127 | print("2. Login") 128 | print("3. Exit") 129 | 130 | choice = input("Select an operation: ") 131 | 132 | if choice == "1": 133 | username = bank_app.user_already_exist() 134 | password = input("Enter a password: ") 135 | bank_app.create_account(username, password) 136 | 137 | elif choice == "2": 138 | username = input("Enter your username: ") 139 | password = input("Enter your password: ") 140 | account = bank_app.login(username, password) 141 | if account: 142 | print("Login successful.") 143 | while True: 144 | print("\nAccount Menu") 145 | print("1. Check Balance") 146 | print("2. Deposit") 147 | print("3. Withdraw") 148 | print("4. Transfer") 149 | print("5. Logout") 150 | 151 | account_choice = input("Select an operation: ") 152 | 153 | if account_choice == "1": 154 | balance = bank_app.check_balance(username) 155 | print(f"Balance: ${balance:.2f}") 156 | 157 | elif account_choice == "2": 158 | amount = float(input("Enter deposit amount: ")) 159 | bank_app.deposit(username, amount) 160 | print("Deposit successful.") 161 | 162 | elif account_choice == "3": 163 | amount = float(input("Enter withdrawal amount: ")) 164 | result = bank_app.withdraw(username, amount) 165 | if result == "Insufficient balance": 166 | print("Insufficient balance.") 167 | else: 168 | print("Withdrawal successful.") 169 | 170 | elif account_choice == "4": 171 | receiver_username = input("Enter receiver's username: ") 172 | amount = float(input("Enter transfer amount: ")) 173 | result = bank_app.transfer(username, receiver_username, amount) 174 | if result == "Insufficient balance": 175 | print("Insufficient balance.") 176 | else: 177 | print("Transfer successful.") 178 | 179 | elif account_choice == "5": 180 | break 181 | else: 182 | print("Login failed. Invalid username or password.") 183 | 184 | elif choice == "3": 185 | bank_app.close() 186 | break 187 | 188 | 189 | if __name__ == "__main__": 190 | main() 191 | ``` -------------------------------------------------------------------------------- /Projects/Dictionary Application.md: -------------------------------------------------------------------------------- 1 | # **Dictionary Application** 2 | 3 | The "Dictionary Application" is a simple Python program that allows users to manage a dictionary of words, their meanings, and example sentences. This project is designed to help you practice your Python programming skills and gain experience in working with databases. It offers the following features: 4 | 5 | ### Key Features: 6 | 7 | 1. **Add Word:** Users can add new words to the dictionary, along with their meanings and example sentences. 8 | 2. **List Words:** The application displays a list of all the words in the dictionary, including their meanings and example sentences. 9 | 3. **Search Word:** Users can search for a specific word in the dictionary to find its meaning and example sentence. 10 | 4. **Delete Word:** The application allows users to delete words from the dictionary. 11 | 12 | ### Project Structure: 13 | 14 | - The program uses an SQLite database to store word data, with a table named "words" to manage entries. 15 | - It includes a `DictionaryApp` class that encapsulates the functionality of the application, making it organized and easy to maintain. 16 | - The user interacts with the application through a simple command-line interface. 17 | 18 | ### How to Use: 19 | 20 | 1. Run the Python program. 21 | 2. Select from the available options to add words, list words, search for words, delete words, or exit the application. 22 | 23 | ### Why This Project? 24 | 25 | This project serves as a practical exercise for beginner and intermediate Python programmers. It covers fundamental concepts such as working with databases, user input, and class-based application structure. By completing this project, you will improve your Python skills and be better equipped for more complex programming tasks. 26 | 27 | 28 | ### Suggested Enhancements: 29 | 30 | To further expand and enhance this project, you can consider adding features like: 31 | 32 | - Update/Edit Word: Allow users to modify the meaning or example sentence of an existing word. 33 | - User Authentication: Implement user accounts and authentication for managing personal dictionaries. 34 | - Better User Interface: Develop a graphical user interface (GUI) for a more user-friendly experience. 35 | 36 | Feel free to explore and customize this project to suit your learning goals and interests. Happy coding! 37 | 38 | 39 | 40 | ```python 41 | import sqlite3 42 | 43 | class DictionaryApp: 44 | def __init__(self,db_name): 45 | self.conn = sqlite3.connect(db_name) 46 | self.cursor = self.conn.cursor() 47 | self.create_table() 48 | 49 | def create_table(self): 50 | self.cursor.execute(''' 51 | CREATE TABLE IF NOT EXISTS words( 52 | id INTEGER PRIMARY KEY, 53 | word TEXT, 54 | meaning TEXT, 55 | sentence TEXT 56 | ) 57 | ''') 58 | self.conn.commit() 59 | 60 | def add_word(self,word,meaning,sentence): 61 | self.cursor.execute("INSERT INTO words (word, meaning,sentence) VALUES ( ?, ?, ?)",(word,meaning,sentence)) 62 | self.conn.commit() 63 | 64 | def list_words(self): 65 | self.cursor.execute("SELECT * FROM words") 66 | words = self.cursor.fetchall() 67 | return words 68 | 69 | def search_word(self, word): 70 | self.cursor.execute("SELECT * FROM words WHERE word LIKE ? ORDER BY word ASC", ('%' + word + '%',)) 71 | word = self.cursor.fetchall() 72 | return word 73 | 74 | def delete_word(self,word): 75 | self.cursor.execute('DELETE FROM words WHERE word = ?',(word,)) 76 | self.conn.commit() 77 | 78 | def close(self): 79 | self.conn.close() 80 | 81 | def main(): 82 | dictionary = DictionaryApp("words.db") 83 | while True: 84 | print("\n Dictionary Application") 85 | print("1 : Add Words") 86 | print("2 : list Words") 87 | print("3 : Search Words") 88 | print("4 : Delete Words") 89 | print("5 : Exit") 90 | 91 | choice = input("Select an operations : ") 92 | if choice == "1" : 93 | word = input("Word: ") 94 | meaning = input("Meaning: ") 95 | sentence = input("Example Sentence: ") 96 | dictionary.add_word(word,meaning,sentence) 97 | print("Word added successfully...") 98 | 99 | elif choice == "2" : 100 | words = dictionary.list_words() 101 | if words: 102 | print("\nWord List : ") 103 | for word in words: 104 | print(f"Words : {word[1]}, \nMeaning : {word[2]}, \nExample Sentence : {word[3]}") 105 | else : 106 | print("no words are added here now") 107 | 108 | elif choice == "3": 109 | word = input("Enter Word to Search: ") 110 | print(word) 111 | result = dictionary.search_word(word) 112 | if result: 113 | for word in result: 114 | print(f"Words : {word[1]}, \nMeaning : {word[2]}, \nExample Sentence : {word[3]}") 115 | else: 116 | print("Word not found.") 117 | 118 | elif choice == "4": 119 | word = input("Enter Word to Delete: ") 120 | dictionary.delete_word(word) 121 | print("Word deleted.") 122 | 123 | elif choice == "5": 124 | dictionary.close() 125 | break 126 | 127 | if __name__ == "__main__": 128 | main() 129 | 130 | ``` 131 | 132 | This program creates a class called `DictionaryApp` that allows users to add words, list words, search for words, and delete words. It uses an SQLite database named "words.db" to store word data. Before running the program, make sure to create the "words.db" SQLite database file in the same directory or change the database name accordingly. -------------------------------------------------------------------------------- /Projects/Notepad Application.md: -------------------------------------------------------------------------------- 1 | # **Last Project: Simple Notepad Application with Classes** 2 | 3 | ## **Project Description:** 4 | Create a Simple Notepad Application in Python using classes. This project will help you improve your file handling, user input, and basic data management skills. 5 | 6 | ### **Key Features:** 7 | 1. Create a user interface that prompts the user to enter a note title and content. 8 | 2. Save user-entered notes to a text file. 9 | 3. Add a "View Notes" option so that the user can list the saved notes. 10 | 4. Add options that allow the user to delete or edit a specific note. 11 | 12 | ### **Extra Tips:** 13 | - Allow the user to provide a unique ID for each note, so they can manage notes more easily. 14 | - Get confirmation from the user when editing or deleting notes and add security checks against errors. 15 | - You can add a custom display layout to display your notes by formatting or coloring them properly. 16 | 17 | **Project Implementation:** 18 | 19 | ```python 20 | import os 21 | import os 22 | 23 | class Notepad: 24 | def __init__(self): 25 | self.notes = [] 26 | 27 | def create_note(self): 28 | note_id = input("Enter a unique ID for the note: ") 29 | title = input("Enter the note title: ") 30 | content = input("Enter the note content: ") 31 | self.notes.append({"id": note_id, "title": title, "content": content}) 32 | print("Note has been created.") 33 | 34 | def view_notes(self): 35 | if not self.notes: 36 | print("No notes found.") 37 | else: 38 | print("Available Notes:") 39 | for note in self.notes: 40 | print(f"ID: {note['id']}, Title: {note['title']}") 41 | 42 | def edit_note(self): 43 | note_id = input("Enter the ID of the note you want to edit: ") 44 | for note in self.notes: 45 | if note['id'] == note_id: 46 | new_title = input(f"Enter a new title for note {note_id}: ") 47 | new_content = input(f"Enter new content for note {note_id}: ") 48 | note['title'] = new_title 49 | note['content'] = new_content 50 | print(f"Note {note_id} has been edited.") 51 | return 52 | print(f"No note found with ID {note_id}.") 53 | 54 | def delete_note(self): 55 | note_id = input("Enter the ID of the note you want to delete: ") 56 | for note in self.notes: 57 | if note['id'] == note_id: 58 | self.notes.remove(note) 59 | print(f"Note {note_id} has been deleted.") 60 | return 61 | print(f"No note found with ID {note_id}.") 62 | 63 | def save_notes_to_file(self): 64 | with open("notes.txt", "w") as file: 65 | for note in self.notes: 66 | file.write(f"ID: {note['id']}\n") 67 | file.write(f"Title: {note['title']}\n") 68 | file.write(f"Content: {note['content']}\n") 69 | file.write("\n") 70 | 71 | def load_notes_from_file(self): 72 | if os.path.isfile("notes.txt"): 73 | with open("notes.txt", "r") as file: 74 | lines = file.readlines() 75 | note_info = {} 76 | for line in lines: 77 | if line.strip() == "": 78 | if note_info: 79 | self.notes.append(note_info) 80 | note_info = {} 81 | else: 82 | key, value = line.strip().split(": ") 83 | note_info[key.lower()] = value 84 | if note_info: 85 | self.notes.append(note_info) 86 | else: 87 | print("No notes file found.") 88 | 89 | def run(self): 90 | self.load_notes_from_file() 91 | while True: 92 | print("\nSimple Notepad Application Menu:") 93 | print("1. Create a Note") 94 | print("2. View Notes") 95 | print("3. Edit a Note") 96 | print("4. Delete a Note") 97 | print("5. Save Notes to File") 98 | print("6. Exit") 99 | choice = input("Enter your choice: ") 100 | 101 | if choice == '1': 102 | self.create_note() 103 | elif choice == '2': 104 | self.view_notes() 105 | elif choice == '3': 106 | self.edit_note() 107 | elif choice == '4': 108 | self.delete_note() 109 | elif choice == '5': 110 | self.save_notes_to_file() 111 | elif choice == '6': 112 | print("Exiting Notepad Application.") 113 | break 114 | else: 115 | print("Invalid choice. Please try again.") 116 | 117 | if __name__ == "__main__": 118 | notepad = Notepad() 119 | notepad.run() 120 | ``` 121 | 122 | **Project Outcome:** 123 | By completing this project, you will have a functional Notepad Application that allows users to create, view, edit, and delete notes, as well as save and load notes from a file. This project will enhance your Python skills and provide practical experience in building text-based applications. 124 | 125 | Feel free to customize and expand this project as you see fit, adding more features or improving the user interface to make it even more user-friendly. Enjoy coding! -------------------------------------------------------------------------------- /Projects/Password Generator.md: -------------------------------------------------------------------------------- 1 | # Random Password Generator 2 | 3 | The "Random Password Generator" is a Python program that allows users to generate random passwords based on their preferences. This project is designed to help you practice Python programming and gain experience in working with strings, randomization, and user interaction. 4 | 5 | ## Key Features: 6 | 7 | 1. **Generate Password:** Users can create random passwords of specified lengths with options for uppercase letters, lowercase letters, digits, and symbols. 8 | 2. **Save Password:** The program offers the option to save generated passwords to a file for later use. 9 | 3. **User-Friendly Interface:** The user interacts with the program through a command-line interface, making it easy to use. 10 | 11 | ## How to Use: 12 | 13 | 1. Run the Python program. 14 | 2. Specify the desired password length. 15 | 3. Choose whether to include uppercase letters, lowercase letters, digits, and symbols in the password. 16 | 4. The program generates a random password based on your preferences. 17 | 5. You can choose to save the password to a file. 18 | 19 | ## Suggested Enhancements: 20 | 21 | To further expand and enhance this project, you can consider adding features like: 22 | 23 | - Password Strength Evaluation: Implement a feature that evaluates the strength of the generated passwords. 24 | - Password History: Allow users to store and manage a history of generated passwords. 25 | - Custom Character Sets: Enable users to define their custom character sets for password generation. 26 | 27 | Feel free to explore and customize this project to suit your learning goals and interests. Happy coding! 28 | 29 | 30 | ```python 31 | import random 32 | import string 33 | 34 | class PasswordGenerator: 35 | def __init__(self): 36 | pass 37 | 38 | def generate_password(self, length, use_uppercase, use_lowercase, use_digits, use_symbols): 39 | # Ready-made character sets 40 | uppercase_letters = string.ascii_uppercase 41 | lowercase_letters = string.ascii_lowercase 42 | digits = string.digits 43 | symbols = string.punctuation 44 | 45 | # Create the character set based on user choices 46 | characters = "" 47 | if use_uppercase: 48 | characters += uppercase_letters 49 | if use_lowercase: 50 | characters += lowercase_letters 51 | if use_digits: 52 | characters += digits 53 | if use_symbols: 54 | characters += symbols 55 | 56 | # Generate a random password of the specified length 57 | if characters: 58 | password = ''.join(random.choice(characters) for _ in range(length)) 59 | return password 60 | else: 61 | return "Character set not selected." 62 | 63 | def save_password_to_file(self, password, filename): 64 | with open(filename, "w") as file: 65 | file.write(password) 66 | 67 | def main(self): 68 | print("Random Password Generator") 69 | 70 | length = int(input("Password Length: ")) 71 | 72 | use_uppercase = input("Use Uppercase Letters? (Y/N): ").lower() == "y" 73 | use_lowercase = input("Use Lowercase Letters? (Y/N): ").lower() == "y" 74 | use_digits = input("Use Digits? (Y/N): ").lower() == "y" 75 | use_symbols = input("Use Symbols? (Y/N): ").lower() == "y" 76 | 77 | password = self.generate_password(length, use_uppercase, use_lowercase, use_digits, use_symbols) 78 | 79 | print("\nGenerated Password:", password) 80 | 81 | save_to_file = input("Save the password to a file? (Y/N): ").lower() == "y" 82 | if save_to_file: 83 | filename = input("Enter the filename: ") 84 | self.save_password_to_file(password, filename) 85 | print(f"Password saved to {filename}") 86 | 87 | if __name__ == "__main__": 88 | password_generator = PasswordGenerator() 89 | password_generator.main() 90 | ``` 91 | 92 | ## Example Output: 93 | 94 | ```bash 95 | $ python random_password_generator.py 96 | 97 | Random Password Generator 98 | 99 | Password Length: 12 100 | Use Uppercase Letters? (Y/N): Y 101 | Use Lowercase Letters? (Y/N): Y 102 | Use Digits? (Y/N): Y 103 | Use Symbols? (Y/N): N 104 | 105 | Generated Password: AbCdeFgH1234 106 | 107 | Save the password to a file? (Y/N): Y 108 | Enter the filename: my_password.txt 109 | Password saved to my_password.txt 110 | ``` 111 | 112 | Before running the program, make sure you have Python installed on your system. Enjoy generating random passwords! -------------------------------------------------------------------------------- /Projects/Readme.md: -------------------------------------------------------------------------------- 1 | # Python Projects 2 | 3 | Welcome to the Python Projects section! Here, you'll find a collection of practical Python projects to help you apply your programming knowledge and build useful applications. Each project is designed to reinforce specific Python skills and concepts. 4 | 5 | 6 | 7 | ## Available Projects 8 | 9 | 1. [Banking Application](Bank%20Application.md): A banking application that allows users to manage their accounts, check balances, and perform transactions securely. 10 | 2. [Dictionary Application](Dictionary%20Application.md): A simple dictionary application where users can add, list, search, and delete words along with their meanings and example sentences. 11 | 3. [Notepad Application](Notepad%20Application.md): A basic notepad application that lets users create and save text-based notes in a user-friendly interface. 12 | 4. [Password Generator](Password%20Generator.md): A password generator that creates strong and customizable passwords with various character sets and saving options. 13 | 5. [Weather Application](Weather%20Application.md): A weather application that provides real-time weather information for a specified city, including temperature, humidity, and more. 14 | 6. [To-Do List Application](To-Do-List-Application.md): A to-do list application that allows users to manage their tasks and stay organized with a command-line interface. 15 | 7. [Vehicle Rental Application](Vehicle%20Rental%20Application.md): A vehicle rental application that enables users to rent and manage vehicles, making use of a secure login system and database storage. 16 | 17 | ## How to Use 18 | 19 | To get started with a project, navigate to its respective directory and follow the instructions provided in the project's README.md file. Each project directory contains the necessary code files and instructions for usage. 20 | 21 | ## Why These Projects? 22 | 23 | These projects are designed to give you hands-on experience and practical insights into Python programming. By working on them, you'll not only enhance your Python skills but also create useful applications that can be applied in real-world scenarios. 24 | 25 | ## Suggested Enhancements 26 | 27 | We hope you find these Python projects both educational and enjoyable. Happy coding! 28 | -------------------------------------------------------------------------------- /Projects/To-Do-List-Application.md: -------------------------------------------------------------------------------- 1 | # To-Do List Application 2 | 3 | This simple To-Do List application helps you keep track of your tasks and manage them efficiently. It is developed using Python and utilizes an SQLite database for data storage. 4 | 5 | ## About the Project 6 | 7 | This To-Do List application allows users to add, list, mark as complete, or delete tasks. It uses a simple checkbox to track the completion status of tasks and stores tasks permanently using an SQLite database. 8 | 9 | ## Project Structure 10 | 11 | - The application contains a `ToDoApp` class responsible for handling SQLite database operations. 12 | - It uses a table named "todos" in the database. 13 | - It provides a basic command-line interface for user interaction. 14 | 15 | ## How to Use 16 | 17 | 1. Create an SQLite database file named `todo.db` in the project directory or rename it as needed. 18 | 2. Run the application: `python todo_app.py`. 19 | 3. When the application starts, you can perform the following operations: 20 | - Choose "1" to add a task. 21 | - Select "2" to list tasks. 22 | - Perform task marking or deletion operations. 23 | - Choose "5" to exit the application. 24 | 25 | ## Why This Project 26 | 27 | This project helps you enhance your Python programming skills while learning how to work with databases. It also involves creating a basic application structure and handling user input. 28 | 29 | ## Suggested Enhancements 30 | 31 | To customize or extend this basic To-Do List application, consider the following enhancements: 32 | 33 | - Create a more user-friendly command-line interface. 34 | - Add features to categorize tasks. 35 | - Consider adding task dates and reminders. 36 | - Manage task priorities. 37 | - Develop a web-based version or improve the existing application interface. 38 | 39 | ## Code Examples 40 | 41 | ```python 42 | import sqlite3 43 | 44 | class ToDoApp: 45 | def __init__(self, db_name): 46 | self.conn = sqlite3.connect(db_name) 47 | self.cursor = self.conn.cursor() 48 | self.create_table() 49 | 50 | def create_table(self): 51 | self.cursor.execute(''' 52 | CREATE TABLE IF NOT EXISTS todos ( 53 | id INTEGER PRIMARY KEY, 54 | task TEXT, 55 | completed BOOLEAN 56 | ) 57 | ''') 58 | self.conn.commit() 59 | 60 | def add_task(self, task): 61 | self.cursor.execute("INSERT INTO todos (task, completed) VALUES (?, ?)", (task, False)) 62 | self.conn.commit() 63 | 64 | def list_tasks(self): 65 | self.cursor.execute("SELECT * FROM todos") 66 | tasks = self.cursor.fetchall() 67 | return tasks 68 | 69 | def mark_task_completed(self, task_id): 70 | self.cursor.execute("UPDATE todos SET completed = ? WHERE id = ?", (True, task_id)) 71 | self.conn.commit() 72 | 73 | def delete_task(self, task_id): 74 | self.cursor.execute("DELETE FROM todos WHERE id = ?", (task_id,)) 75 | self.conn.commit() 76 | 77 | def close(self): 78 | self.conn.close() 79 | 80 | def main(): 81 | todo_app = ToDoApp("todo.db") 82 | 83 | while True: 84 | print("\nTo-Do List Application") 85 | print("1. Add Task") 86 | print("2. List Tasks") 87 | print("3. Mark Task Completed") 88 | print("4. Delete Task") 89 | print("5. Exit") 90 | 91 | choice = input("Select an operation: ") 92 | 93 | if choice == "1": 94 | task = input("Enter the task: ") 95 | todo_app.add_task(task) 96 | print("Task added.") 97 | 98 | elif choice == "2": 99 | tasks = todo_app.list_tasks() 100 | if tasks: 101 | print("\nTask List:") 102 | for task in tasks: 103 | task_id, task_text, completed = task 104 | status = "Completed" if completed else "Not Completed" 105 | print(f"Task ID: {task_id}, Task: {task_text}, Status: {status}") 106 | else: 107 | print("No tasks found.") 108 | 109 | elif choice == "3": 110 | task_id = input("Enter the task ID to mark as completed: ") 111 | todo_app.mark_task_completed(task_id) 112 | print("Task marked as completed.") 113 | 114 | elif choice == "4": 115 | task_id = input("Enter the task ID to delete: ") 116 | todo_app.delete_task(task_id) 117 | print("Task deleted.") 118 | 119 | elif choice == "5": 120 | todo_app.close() 121 | break 122 | 123 | if __name__ == "__main__": 124 | main() 125 | ``` 126 | Feel free to customize it further to include specific details about your To-Do List application. 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /Projects/Vehicle Rental Application.md: -------------------------------------------------------------------------------- 1 | # Vehicle Rental Application 2 | 3 | The Vehicle Rental Application is a Python program that allows users to manage vehicle rentals. This project is designed to help you practice your Python programming skills, work with databases, and create a command-line application. It offers the following features: 4 | 5 | ## Features 6 | 7 | 1. **Registration & Login**: Users can create an account and log in securely. 8 | 2. **Add Vehicle**: Users can add vehicles to the rental inventory, specifying the vehicle type and ID. 9 | 3. **List Vehicles**: Users can view the list of available vehicles. 10 | 4. **Rent Vehicle**: Users can rent a vehicle, specifying the vehicle ID and rental duration in days. 11 | 5. **Return Vehicle**: Users can return a rented vehicle, and the rental cost is calculated based on the rental duration. 12 | 13 | ## Project Structure 14 | 15 | - The program uses an SQLite database to store user information, vehicle data, and rental records. 16 | - User passwords are securely hashed using SHA-512 before being stored in the database. 17 | - The user interacts with the application through a simple command-line interface. 18 | 19 | ## How to Use 20 | 21 | 1. Run the Python program. 22 | 2. Select from the available options to register, log in, add vehicles, list vehicles, rent a vehicle, return a vehicle, log out, or exit the application. 23 | 3. Follow the on-screen prompts to perform your chosen actions. 24 | 25 | ## Why This Project? 26 | 27 | This project serves as a practical exercise for Python programmers to learn about database management, user authentication, and application structure. By completing this project, you will improve your Python skills and gain experience in building command-line applications. 28 | 29 | ## Suggested Enhancements 30 | 31 | To further expand and enhance this project, you can consider adding the following features: 32 | 33 | - Updating vehicle information. 34 | - Providing more detailed vehicle descriptions. 35 | - Implementing user-friendly error handling and messages. 36 | - Developing a graphical user interface (GUI) for a more user-friendly experience. 37 | 38 | ## Code Examples 39 | ```python 40 | import hashlib 41 | import sqlite3 42 | from datetime import datetime, timedelta 43 | 44 | class VehicleRentalApp: 45 | def __init__(self): 46 | self.conn = sqlite3.connect("rental_app.db") 47 | self.cursor = self.conn.cursor() 48 | self.create_tables() 49 | self.logged_in_user = None 50 | 51 | def create_tables(self): 52 | self.cursor.execute(''' 53 | CREATE TABLE IF NOT EXISTS users ( 54 | id INTEGER PRIMARY KEY, 55 | username TEXT UNIQUE, 56 | password TEXT 57 | ) 58 | ''') 59 | self.cursor.execute(''' 60 | CREATE TABLE IF NOT EXISTS vehicles ( 61 | id INTEGER PRIMARY KEY, 62 | vehicle_id TEXT UNIQUE, 63 | vehicle_type TEXT, 64 | is_available BOOLEAN 65 | ) 66 | ''') 67 | self.cursor.execute(''' 68 | CREATE TABLE IF NOT EXISTS rentals ( 69 | id INTEGER PRIMARY KEY, 70 | user_id INTEGER, 71 | vehicle_id INTEGER, 72 | start_date TEXT, 73 | end_date TEXT, 74 | FOREIGN KEY (user_id) REFERENCES users (id), 75 | FOREIGN KEY (vehicle_id) REFERENCES vehicles (id) 76 | ) 77 | ''') 78 | self.conn.commit() 79 | 80 | def hash_password(self, password): 81 | sha = hashlib.sha512() 82 | sha.update(password.encode('utf-8')) 83 | return sha.hexdigest() 84 | 85 | def register_user(self, username, password): 86 | hashed_password = self.hash_password(password) 87 | try: 88 | self.cursor.execute("INSERT INTO users (username, password) VALUES (?, ?)", (username, hashed_password)) 89 | self.conn.commit() 90 | return "Registration successful. You can now log in." 91 | except sqlite3.IntegrityError: 92 | return "Username already exists. Please choose another username." 93 | 94 | def login(self, username, password): 95 | hashed_password = self.hash_password(password) 96 | self.cursor.execute("SELECT * FROM users WHERE username=? AND password=?", (username, hashed_password)) 97 | user = self.cursor.fetchone() 98 | if user: 99 | self.logged_in_user = user 100 | return "Login successful." 101 | else: 102 | return "Invalid username or password." 103 | 104 | def add_vehicle(self, vehicle_id, vehicle_type): 105 | try: 106 | self.cursor.execute("INSERT INTO vehicles (vehicle_id, vehicle_type, is_available) VALUES (?, ?, ?)", 107 | (vehicle_id, vehicle_type, True)) 108 | self.conn.commit() 109 | return f"{vehicle_type} vehicle added successfully." 110 | except sqlite3.IntegrityError: 111 | return "Vehicle ID already exists. Please choose another ID." 112 | 113 | def list_vehicles(self): 114 | self.cursor.execute("SELECT * FROM vehicles") 115 | vehicles = self.cursor.fetchall() 116 | if vehicles: 117 | print("\nVehicle List:") 118 | for vehicle in vehicles: 119 | availability = "Available" if vehicle[3] else "Not Available" 120 | print(f"Vehicle ID: {vehicle[1]}, Type: {vehicle[2]}, Status: {availability}") 121 | else: 122 | print("No vehicles found.") 123 | 124 | def rent_vehicle(self, vehicle_id, rental_days): 125 | if not self.logged_in_user: 126 | return "Please log in before renting a vehicle." 127 | 128 | self.cursor.execute("SELECT * FROM vehicles WHERE vehicle_id=?", (vehicle_id,)) 129 | vehicle = self.cursor.fetchone() 130 | if not vehicle: 131 | return "Vehicle not found." 132 | if not vehicle[3]: 133 | return "Vehicle is not available for rent." 134 | 135 | start_date = datetime.now().strftime("%Y-%m-%d %H:%M:%S") 136 | end_date = (datetime.now() + timedelta(days=rental_days)).strftime("%Y-%m-%d %H:%M:%S") 137 | user_id = self.logged_in_user[0] 138 | 139 | try: 140 | self.cursor.execute("INSERT INTO rentals (user_id, vehicle_id, start_date, end_date) VALUES (?, ?, ?, ?)", 141 | (user_id, vehicle[0], start_date, end_date)) 142 | self.cursor.execute("UPDATE vehicles SET is_available=0 WHERE id=?", (vehicle[0],)) 143 | self.conn.commit() 144 | return f"Vehicle {vehicle[2]} rented successfully for {rental_days} days." 145 | except sqlite3.IntegrityError: 146 | return "An error occurred while renting the vehicle." 147 | 148 | def return_vehicle(self, rental_id): 149 | if not self.logged_in_user: 150 | return "Please log in before returning a vehicle." 151 | 152 | self.cursor.execute("SELECT * FROM rentals WHERE id=?", (rental_id,)) 153 | rental = self.cursor.fetchone() 154 | if not rental: 155 | return "Rental not found." 156 | 157 | start_date = datetime.strptime(rental[3], "%Y-%m-%d %H:%M:%S") 158 | end_date = datetime.strptime(rental[4], "%Y-%m-%d %H:%M:%S") 159 | rental_duration = (end_date - start_date).days 160 | rental_cost = self.calculate_rental_cost(rental_duration) 161 | 162 | try: 163 | self.cursor.execute("DELETE FROM rentals WHERE id=?", (rental_id,)) 164 | self.cursor.execute("UPDATE vehicles SET is_available=1 WHERE id=?", (rental[2],)) 165 | self.conn.commit() 166 | return f"Vehicle returned. Rental duration: {rental_duration} days, Total cost: {rental_cost} TL." 167 | except sqlite3.IntegrityError: 168 | return "An error occurred while returning the vehicle." 169 | 170 | def calculate_rental_cost(self, rental_duration): 171 | # Kiralama süresine göre fiyat hesaplaması 172 | daily_rate = 100 # Günlük fiyat 173 | return daily_rate * rental_duration 174 | 175 | def main(self): 176 | while True: 177 | print("\nVehicle Rental App") 178 | print("1. Register") 179 | print("2. Login") 180 | print("3. Add Vehicle") 181 | print("4. List Vehicles") 182 | print("5. Rent Vehicle") 183 | print("6. Return Vehicle") 184 | print("7. Logout") 185 | print("8. Exit") 186 | 187 | choice = input("Please select an option: ") 188 | 189 | if choice == "1": 190 | username = input("Username: ") 191 | password = input("Password: ") 192 | print(self.register_user(username, password)) 193 | 194 | elif choice == "2": 195 | username = input("Username: ") 196 | password = input("Password: ") 197 | print(self.login(username, password)) 198 | 199 | elif choice == "3": 200 | if self.logged_in_user: 201 | vehicle_id = input("Vehicle ID: ") 202 | vehicle_type = input("Vehicle Type: ") 203 | print(self.add_vehicle(vehicle_id, vehicle_type)) 204 | else: 205 | print("Please log in before adding a vehicle.") 206 | 207 | elif choice == "4": 208 | self.list_vehicles() 209 | 210 | elif choice == "5": 211 | if self.logged_in_user: 212 | vehicle_id = input("Vehicle ID to rent: ") 213 | rental_days = int(input("Rental days: ")) 214 | print(self.rent_vehicle(vehicle_id, rental_days)) 215 | else: 216 | print("Please log in before renting a vehicle.") 217 | elif choice == "6": 218 | if self.logged_in_user: 219 | rental_id = int(input("Rental ID to return: ")) 220 | print(self.return_vehicle(rental_id)) 221 | else: 222 | print("Please log in before returning a vehicle.") 223 | elif choice == "7": 224 | self.logged_in_user = None 225 | print("Logged out.") 226 | 227 | elif choice == "8": 228 | self.conn.close() 229 | break 230 | 231 | if __name__ == "__main__": 232 | rental_app = VehicleRentalApp() 233 | rental_app.main() 234 | ``` 235 | 236 | Feel free to explore and customize this project to suit your learning goals and interests. Happy coding! 237 | 238 | 239 | 240 | Happy vehicle renting! 241 | -------------------------------------------------------------------------------- /Projects/Weather Application.md: -------------------------------------------------------------------------------- 1 | Certainly! Here's the introduction for the "Weather Application" project: 2 | 3 | ## Weather Application 4 | 5 | The "Weather Application" is a Python program that allows users to retrieve real-time weather information for a specified city. With this project, you can enhance your Python skills while working with external APIs to fetch live weather data. The application provides data on temperature, humidity, weather description, and wind speed, making it a handy tool for checking the weather in different locations. 6 | 7 | ### Requirements: 8 | 9 | - Python 3.x 10 | - Requests library (install using `pip install requests`) 11 | - An API key from OpenWeatherMap (replace the API key in the code with your own) 12 | 13 | 14 | 15 | ### Why This Project 16 | **Why This Project:** This project serves as a practical exercise for Python programmers to work with external APIs, parse JSON data, and provide real-world value. It offers a chance to explore real-time weather data and practice Python programming. 17 | 18 | ### Key Features: 19 | 1. **Weather Information:** Users can enter the name of a city, and the application fetches and displays the current weather data. 20 | 2. **Temperature in Celsius:** The temperature is provided in Celsius, making it easy to understand for users worldwide. 21 | 3. **Humidity Percentage:** Users can check the humidity level in the specified city. 22 | 4. **Weather Description:** Get a brief description of the current weather conditions. 23 | 5. **Wind Speed:** Find out the wind speed in meters per second for the selected location. 24 | 25 | ### Project Structure 26 | - The program is organized into a Python class called `WeatherApp`. 27 | - It uses the `requests` library to fetch data from the OpenWeatherMap API. 28 | - Users interact with the application through a simple command-line interface. 29 | - An OpenWeatherMap API key is required for accessing weather data. 30 | 31 | 32 | ### How to Use: 33 | 1. Run the Python program. 34 | 2. Enter the name of the city you want to check the weather for. 35 | 3. The application will retrieve and display the real-time weather data for the city. 36 | 4. To exit the program, type 'q' and press Enter. 37 | 38 | ### Suggested Enhancements 39 | - **Multiple Cities:** Allow users to check the weather for multiple cities in a single run. 40 | - **Forecast Data:** Extend the application to provide weather forecasts for upcoming days. 41 | - **Graphical Interface:** Create a graphical user interface (GUI) for a more user-friendly experience. 42 | 43 | And here's the code for the "Weather Application": 44 | 45 | ```python 46 | import requests 47 | import json 48 | 49 | class WeatherApp: 50 | def __init__(self, api_key): 51 | self.api_key = api_key 52 | self.base_url = "https://api.openweathermap.org/data/2.5/weather" 53 | 54 | def get_weather(self, city): 55 | try: 56 | params = { 57 | "q": city, 58 | "appid": self.api_key, 59 | "units": "metric" # Celsius 60 | } 61 | 62 | response = requests.get(self.base_url, params=params) 63 | data = json.loads(response.text) 64 | 65 | if response.status_code == 200: 66 | temperature = data["main"]["temp"] 67 | humidity = data["main"]["humidity"] 68 | description = data["weather"][0]["description"] 69 | wind_speed = data["wind"]["speed"] 70 | 71 | print(f"Weather in {city}:") 72 | print(f"Temperature: {temperature}°C") 73 | print(f"Humidity: {humidity}%") 74 | print(f"Description: {description}") 75 | print(f"Wind Speed: {wind_speed} m/s") 76 | else: 77 | print("Error: Unable to fetch weather data.") 78 | 79 | except Exception as e: 80 | print(f"An error occurred: {str(e)}") 81 | 82 | def main(): 83 | api_key = "you api key" # Replace with your OpenWeatherMap API key 84 | weather_app = WeatherApp(api_key) 85 | 86 | while True: 87 | city = input("Enter city name (or 'q' to quit): ") 88 | if city.lower() == 'q': 89 | break 90 | 91 | weather_app.get_weather(city) 92 | 93 | if __name__ == "__main__": 94 | main() 95 | ``` 96 | 97 | ### Example Output: 98 | 99 | ```bash 100 | $ python weather_application.py 101 | Enter city name (or 'q' to quit): Mersin 102 | Weather in Mersin: 103 | Temperature: 14.5°C 104 | Humidity: 63% 105 | Description: broken clouds 106 | Wind Speed: 1.72 m/s 107 | Enter city name (or 'q' to quit): q 108 | 109 | Process finished with exit code 0 110 | ``` 111 | 112 | Feel free to use and customize this "Weather Application" for your learning and practical use. -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # 🚀 Python Learning Roadmap in 30 Days 2 | 3 | Welcome to the **Python Learning Roadmap in 30 Days!** This project is designed to guide you through a structured 30-day journey to learn the Python programming language from scratch and master its fundamental concepts. 4 | 5 | ## 🌐 Socials: 6 | [![Denizhalil](https://img.shields.io/badge/Denizhalil-%23E4405F.svg?logo=Denizhalil&logoColor=white)](https://denizhalil.com/) 7 | [![Instagram](https://img.shields.io/badge/Instagram-%23E4405F.svg?logo=Instagram&logoColor=white)](https://instagram.com/deniz.halil333) 8 | [![LinkedIn](https://img.shields.io/badge/LinkedIn-%230077B5.svg?logo=linkedin&logoColor=white)](https://linkedin.com/in/halil-ibrahim-deniz) 9 | [![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?logo=YouTube&logoColor=white)](https://youtube.com/@HalilDeniz) 10 | [![Tryhackme](https://img.shields.io/badge/Tryhackme-%23E4405F.svg?logo=Tryhackme&logoColor=white)](https://tryhackme.com/p/halilovic) 11 | [![E-mail](https://img.shields.io/badge/email-%23E4405F.svg?logo=email&logoColor=white)](halildeniz313@gmail.com) 12 | [![Instagram](https://img.shields.io/badge/Discord-%23E4405F.svg?logo=Discord&logoColor=white)](https://discord.gg/nGBpfMHX4u) 13 | --- 14 | 15 | ![Python Learning Roadmap](source/python-in-30-days.png) 16 | 17 | ## 🐍 Why Python and Why This Roadmap? 18 | 19 | Python is a high-level, versatile programming language known for its readability and simplicity. 20 | It has a vast community and is widely used in various fields, including web development, data science, machine learning, automation, and more. 21 | This roadmap is perfect for beginners and anyone looking to solidify their Python skills. 22 | 23 |

24 | Buy Me A Coffee 25 |

26 | --- 27 | 28 | ## 🛠️ **How to Use** 29 | The project is organized into separate sections for each day, making it easy for you to follow along. 30 | Each day focuses on specific topics and provides practical examples and exercises to reinforce your learning. 31 | To navigate through the content, you can either explore the filenames or refer to the main "README.md" file. 32 | For instance, to access the content for [Day 4-6](30%20Days%20Essentials/Days-4-6.md), simply open the "[Day 4-6.md](30%20Days%20Essentials/Days-4-6.md)" file. 33 | 34 | --- 35 | 36 | ## 📁 Course Content 37 | 38 | ### [Days 1-3](30%20Days%20Essentials/Days-1-3.md): Basic Concepts and Installation 39 | - Understand Python's introduction and why it's popular. 40 | - Learn the basic syntax of Python and its core data types (string, integer, float, list, tuple, dictionary). 41 | - Install Python on your computer. 42 | 43 | ### [Days 4-6](30%20Days%20Essentials/Days-4-6.md): Conditional Statements and Loops 44 | - Master conditional statements (if, elif, else) and logical operators. 45 | - Gain proficiency in using loops (for and while). 46 | 47 | ### [Days 7-10](30%20Days%20Essentials/Days-7-10.md): Data Structures 48 | - Deepen your knowledge of data structures like lists, tuples, and dictionaries. 49 | - Practice working with data structures through hands-on exercises. 50 | 51 | ### [Days 11-14](30%20Days%20Essentials/Days-11-14.md): Functions and Modules 52 | - Define and utilize functions in Python. 53 | - Explore basic Python modules (math, random, datetime). 54 | 55 | ### [Days 15-18](30%20Days%20Essentials/Days-15-18.md): File Handling and Error Handling 56 | - Learn the art of file reading and writing. 57 | - Master error handling techniques using try-except blocks. 58 | 59 | ### [Days 19-22](30%20Days%20Essentials/Days-19-22.md): Object-Oriented Programming (OOP) 60 | - Understand classes and objects. 61 | - Dive into OOP concepts, including inheritance and polymorphism. 62 | 63 | ### [Days 23-26](30%20Days%20Essentials/Days-23-26.md): Database Connection and SQL 64 | - Establish connections with databases (e.g., SQLite). 65 | - Learn to execute basic SQL queries for data manipulation. 66 | 67 | ### [Days 27-30](30%20Days%20Essentials/Days-27-30.md): Web Development and Frameworks 68 | - Explore Python web frameworks like Flask and Django. 69 | - Create a simple web application and gain insights into web development. 70 | 71 | 72 | ### [Python Projects](Projects/Readme.md) 73 | you'll find a collection of practical Python projects to help you apply your programming knowledge and build useful applications. 74 | 75 | * **Simple Notepad Application** 76 | - At the end of the day, you will develop a project to reinforce your Python learning. 77 | - Improve your file manipulation, user input and basic data management skills by creating a simple Notepad application 78 | * **Dictionary Application** 79 | - At the end of the day, you will develop a project to reinforce your Python learning. 80 | - Improve your file manipulation, user input, and basic data management skills by creating a Dictionary application. 81 | * **Random Password Generator** 82 | - Create a random password generator program using Python. 83 | - Allow users to specify password length and character set preferences. 84 | - Provide the option to save generated passwords to a file. 85 | * **Bank Application** 86 | - A Python program that simulates basic banking operations. 87 | - Users can create accounts, log in, check balances, deposit and withdraw money, and transfer funds securely. 88 | - Enhance your Python skills, database management, and security knowledge. 89 | * **Weather Application** 90 | - A Python program that provides real-time weather information for a specified city. 91 | - Users can input a city name and receive data such as temperature, humidity, weather description, and wind speed. 92 | - Enhance your Python skills, work with external APIs, and retrieve live weather data. 93 | * **To-Do List Application** 94 | - A to-do list application that allows users to manage their tasks and stay organized with a command-line interface. 95 | - Practice creating and managing tasks, marking them as completed, and organizing your to-do list efficiently. 96 | * **Vehicle Rental Application** 97 | - A vehicle rental application that enables users to rent and manage vehicles, making use of a secure login system and database storage. 98 | - Implement user registration, vehicle addition, rental management, and secure login features while working with a database. 99 | 100 | ## 📋 Course Structure and Preparation 101 | 102 | Before diving into this roadmap, here's a suggested course structure: 103 | 104 | 1. **Daily Learning**: Dedicate time each day to go through the topics and complete the exercises. 105 | 2. **Hands-On Practice**: Apply what you learn by working on coding exercises and mini-projects. 106 | 3. **Revision**: Regularly review previous days' content to reinforce your knowledge. 107 | 4. **Exploration**: Beyond this roadmap, explore other Python libraries and projects that interest you. 108 | 109 | By following this structured approach, you'll gradually build your Python proficiency and gain confidence in your programming skills. 110 | 111 | --- 112 | 113 | ## 📖 BONUS: My Book 114 | - Python Learning Roadmap in 30 Days: [here](https://github.com/HalilDeniz/Python30Days) 115 | - You can look here for the Practical [Posts I share.](https://www.buymeacoffee.com/halildeniz/posts) 116 | - Mastering Scapy: A Comprehensive Guide to [Network Analysis](https://denizhalil.com/2023/11/12/scapy-guide-to-network-analysis-book/) 117 | - Beginning Your Journey in Programming and Cybersecurity - [Navigating the Digital Future](https://www.buymeacoffee.com/halildeniz/e/191664) 118 | - Python articles for you on our site - [Click here](https://denizhalil.com/category/python/) 119 | - Programming articles you on our site - [Click here](https://denizhalil.com/category/programming/) 120 | --- 121 | 122 | ## 📬 How Can You Provide Feedback? 123 | 1. **Reporting a Problem:** If you encounter any bugs or issues, you can report it here. Please, the more detailed you describe the problem, the faster you will help resolve it. 124 | 2. **Ideas and Improvements:** If you have new suggestions or ideas for improving the project, you can share them here. Your community feedback is important. 125 | 3. **Share Your Projects:** You can showcase the projects or works you wrote during your Python learning journey here. Share your experiences with other learners. 126 | 127 | --- 128 | 129 | ## 🤝 Contribution 130 | 131 | This project is open source, and we welcome contributions from the community. If you'd like to add new learning material to the roadmap or make corrections to existing content, please submit a pull request. 132 | 1. Fork the repository. 133 | 2. Create a new branch for your feature or bug fix. 134 | 3. Make your changes and commit them. 135 | 4. Push your changes to your forked repository. 136 | 5. Open a pull request in the main repository. 137 | 138 | --- 139 | 140 | ## 💰 Support the Project 141 | 142 | If you find this project helpful, please consider supporting me. 143 | Your support allows me to dedicate more time and effort to creating useful projects like Python30Days and developing new tools and resources. 144 | By contributing, you're not only helping improve existing tools but also inspiring new ideas and innovations. 145 | Thank you for your support! Together, let's continue building and learning. 146 | 147 | [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/halildeniz) 148 | [![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/denizhalil) 149 | 150 | Happy coding, and enjoy your Python learning journey! 151 | 152 | --- 153 | 154 | ## License 155 | 156 | **Python Learning Roadmap in 30 Days** is licensed under the MIT License. You can find the details in the [LICENSE](LICENSE) file. 157 | -------------------------------------------------------------------------------- /source/projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalilDeniz/Python30Days/b6d5f0ab3fd6708a43ef86e6b585e407e38b0802/source/projects.png -------------------------------------------------------------------------------- /source/python-in-30-days.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalilDeniz/Python30Days/b6d5f0ab3fd6708a43ef86e6b585e407e38b0802/source/python-in-30-days.png --------------------------------------------------------------------------------