Lesson 2 of 33
Overview of Intermediate-Level Python Topics
The course “Intermediate Python” is designed to build upon the foundational concepts learned in the “Introduction to Python” course. In this course, we will delve deeper into advanced Python programming techniques and explore additional libraries and tools that are commonly used in the Python ecosystem.
Overview of This Course
Some of the topics that we will cover in this course include:
- Object-Oriented Programming (OOP): In this section, we will learn about the principles of OOP and how to define and use classes in Python. We will also learn about inheritance, polymorphism, and encapsulation.
- Working with Files: In this section, we will learn how to read and write different types of files in Python, such as JSON, XML, and binary files. We will also learn how to manipulate file paths and handle exceptions when working with files.
- Advanced Data Structures: In this section, we will learn about advanced data structures in Python, such as sets, tuples, and collections. We will also learn how to use these data structures to solve common programming problems.
- Regular Expressions: In this section, we will learn about regular expressions and how to use them to search, match, and extract data from strings.
- Working with Databases: In this section, we will learn how to connect to and manipulate data in a database using Python. We will learn about different database drivers and how to use SQL to query and modify data.
- Networking: In this section, we will learn how to use Python to communicate with servers over a network. We will learn how to make HTTP requests, send emails, and work with sockets.
- Asynchronous Programming: In this section, we will learn about asynchronous programming in Python and how to use asyncio to write concurrent and parallel code.
- Testing: In this section, we will learn about testing in Python and how to use the unittest library to write and run unit tests.
This course will provide a comprehensive overview of intermediate-level Python topics and equip you with the skills and knowledge needed to tackle more advanced projects and challenges.
To review these concepts, we will go through a series of exercises designed to test your understanding and apply what you have learned.
Write a function that takes a list of integers as an argument and returns the sum of the list.
def sum_list(lst): sum = 0 for number in lst: sum += number return sum
Write a function that takes a list of strings as an argument and returns a new list with all the strings in uppercase.
def to_uppercase(lst): new_lst =  for string in lst: new_lst.append(string.upper()) return new_lst
Write a function that takes a dictionary as an argument and returns a list of all the keys in the dictionary.
def get_keys(dct): return list(dct.keys())
Write a function that takes a dictionary as an argument and returns a list of all the values in the dictionary.
def get_values(dct): return list(dct.values())
Write a function that takes a list of dictionaries as an argument and returns a new list with all the dictionaries sorted by the value of their “age” key.
def sort_by_age(lst): return sorted(lst, key=lambda dct: dct['age'])