This repository contains a list of exercises I am practicing as part of the Python-3 course on YouTube by Gustavo Guanabara. These exercises are designed to help solidify my understanding of Python concepts and syntax.
-
Variables and Data Types
- Assign values to variables and print them
- Declare variables with different data types (int, float, string, boolean)
- Convert data types using functions like
int()
,float()
, andstr()
- Use the
type()
function to check the data type of a variable
-
Operators and Expressions
- Use arithmetic operators (+, -, *, /, //) to perform calculations
- Use comparison operators (==, !=, >, <, >=, <=) to compare values
- Use logical operators (and, or, not) to create complex expressions
- Use the
abs()
function to find the absolute value of a number
-
Control Flow Statements
- Use if statements to execute code based on conditions
- Use elif statements to provide additional conditions
- Use else statements to execute code when no conditions are met
- Use loops (for and while) to repeat code multiple times
-
Functions
- Define functions with parameters and return values
- Call functions and pass arguments
- Use default parameter values
- Use keyword arguments to pass arguments by name
-
Lists
- Create lists with elements separated by commas
- Access list elements using indexing
- Modify list elements using indexing
- Use slicing to extract a portion of a list
- Use list methods like
append()
,insert()
,remove()
, andsort()
-
Tuples
- Create tuples with elements separated by commas
- Access tuple elements using indexing
- Cannot modify tuple elements
- Use tuple unpacking to assign multiple variables at once
-
Dictionaries
- Create dictionaries with key-value pairs separated by colons
- Access dictionary values using keys
- Modify dictionary values using keys
- Use dictionary methods like
keys()
,values()
, anditems()
-
File Input/Output
- Open and close files using the
open()
function - Read file contents using the
read()
method - Write file contents using the
write()
method - Append file contents using the
append()
method
- Open and close files using the
-
Exception Handling
- Use try-except blocks to handle exceptions
- Use the
try
block to execute code that may raise an exception - Use the
except
block to handle specific exceptions - Use the
finally
block to execute code regardless of whether an exception is raised
-
Modules and Packages
- Import modules using the
import
statement - Use module functions and classes
- Use the
__name__
variable to determine if a module is being run directly or imported - Create packages by creating a directory with an
__init__.py
file
These exercises cover a wide range of Python concepts and syntax, and I will continue to practice and refine my skills in these areas.
- Idle;
- PyCharm -> productive coding in PyCharm;