Skip to content

Python exercises from the Python-3 course in a video on YT

Notifications You must be signed in to change notification settings

anaisateodoro/python-for-beginners

Repository files navigation

Python Exercises from Python-3 Course in Video on YT

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.

  1. 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(), and str()
    • Use the type() function to check the data type of a variable
  2. 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
  3. 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
  4. 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
  5. 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(), and sort()
  6. 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
  7. 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(), and items()
  8. 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
  9. 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
  10. 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.

Ide

About

Python exercises from the Python-3 course in a video on YT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages