: David Armendáriz, #NeverStopLearning
: 3h 47m
Welcome to Learn Python by doing!
Tired of the same Python course teaching you data types and printing the same message in a for loop? It's time to learn exciting things!
In this course, you will learn a lot of built in functionalities for you to become a better Python developer. You will also learn how to implement best practices and some unit testing. Some of the things that you will learn in this course are:
• The zip function
• The map function
• The reduce function
• How to implement your own iterators and generators
• How to use the sorted method like a pro
• Learn about Python closures
• Learn about decorators and some useful ones that come with Python
• Sets and why are they cool
• Unit testing with Pytest
And more! Also, you will be asked to do some interesting exercises in the class project, so you reinforce what you learn in this course.
Have fun and enjoy!
Projects & Resources
The class project is going to be a series of exercises where you will need to use what you learn in this course. Avoid the use of for loops.
1. Write a function that sums two numbers like in school. This means, that you should sum digits from right to left and carry 1 if the sum of two digits is greater than or equal to 10. HINT: you should use the zip_longest function and the modulo operator (%).
2. In school, you may have done this without knowing that this algorithm also works for numbers in any base. Refactor this function in order to sum two numbers in any given base. HINT: your function should now receive the base as an argument. Your function should sum like in the first point if you pass 10 as the number base. If you pass 2, then you will be able to sum binary numbers!
3. Remember that we said that in TDD, we should first write a failing test and then start writing code. We are going to break this rule for a moment. Implement some tests with pytest in order to show that your function works perfectly. Make sure to write tests for differente number bases.
The second exercise is related to generators! In this course you learned how to build them. Now let's implement two generators that are interesting.
1. Implement a generator that yields the Fibonnaci numbers. Take advantage of the fact that local state is rememberd on subsequent calls to the generator. Remember the definition of Fibonacci numbers in this Wikipedia article: Fibonacci Numbers
2. Make a generator that yields prime numbers. Remember the definition of prime numbers in this article: Prime numbers
3. Now instead of returning the number, return also the time it took to yield the next prime number. Store the numbers and times in such a way that you can make a simple scatter plot where you will put the prime numbers in the x-axis and the time in the y-axis. You can see an example of how to do this with Matplotlib and Numpy in this article: Scatterplots.
(Visit Official page to get resources that given by OP under ''Projects & Resources'' tab)
Skills in this Class
• Web Development
• Big Data
• Career Development
• Educational Technology
• Business Intelligence
Hi! I am David Armendáriz and I am an ecuadorian mathematician. I like everything related to Data Science and also I like to apply my knowledge in this topic to software...