An open API service indexing awesome lists of open source software.

https://github.com/saylidholam/practice_python


https://github.com/saylidholam/practice_python

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

# Practice_Python

Welcome to my Practice_Python GitHub repository!

This guide is designed to help you get started with Python, covering fundamental concepts such as basic arithmetic operations, loops, lists, conditional statements, functions, and connecting to MySQL databases.




TABLE OF CONTENTS

1. Basic Arithmetic Operations

2. Loops

3. Lists

4. Conditional Statements (if-else & ladder)

5. Functions

6. MySQL Connection




Basic Arithmetic Operations

Python supports all basic arithmetic operations such as addition (+), subtraction (-), multiplication (*), division (/), and exponentiation (**).
These operations can be performed on numerical data types like integers and floating-point numbers.

arithmetic operations in python


Loops

Loops in Python are used to repeatedly execute a block of code until a certain condition is met. There are two main types of loops: for loops and while loops. for loops iterate over a sequence (e.g., a list, tuple, or string), while while loops continue iterating as long as a specified condition is true.

loops in python


Lists

Lists are a fundamental data structure in Python used to store collections of items. Lists are ordered and mutable, meaning you can change the elements they contain. Elements in a list can be of different data types, and you can perform various operations on lists such as adding elements, removing elements, accessing elements by index, and iterating over the list using loops.

lists in python


Conditional Statements

Conditional statements like if, else, and elif (short for "else if") are used in Python to control the flow of the program based on certain conditions. The if statement allows you to execute a block of code only if a specified condition is true. The else statement is used to execute a block of code if the condition of the if statement is false. The elif statement allows you to check multiple conditions sequentially.

conditional statements in python


Functions

Functions in Python are reusable blocks of code that perform a specific task. They allow you to break down your code into smaller, manageable pieces, making it easier to read, understand, and maintain. Functions can take input parameters, perform operations on them, and optionally return a result. They help promote code reusability and modularity..

functions in python


MySQL Connection

Python provides various libraries for connecting to MySQL databases, such as mysql-connector-python. These libraries allow you to establish a connection to a MySQL database server, execute SQL queries, fetch results, and perform database operations programmatically from within your Python code. MySQL connections typically involve providing connection parameters like host, username, password, and database name.)

MySQL connection in python