DEV Community

Jonathan Reeves
Jonathan Reeves

Posted on

Codecademy Data Science Course Part IV

Intro To Python

Hello, welcome back to my series of posts on the Codecademy Data Science course. I know it's been a few days since my last post. I apologize for that. However the Python material seemed to go a little bit more in depth with a lot more modules this go round. So without further ado let's get into it.

Python Functions and Logic

This is the first module on Python. It starts with a brief introduction to the Python syntax as well as the first function that you are pretty much ever introduced to in most languages. The print() function. In JavaScript this is known as console.log(). Same principle. It prints the variable content, string, number etc to the console so you can view it's contents. Of course when you are starting out you aren't really printing the outcome of functions and variables so you are mainly just using strings and numeric equations to see that Python can be used as a pretty handy calculator or messenger.

The project in this section has you use the print() function to display what would be a receipt at a popular furniture store. You use the knowledge of the previous exercises to print out a receipt like message to the console of the items a customer has bought on their purchase. It was a pretty neat spin on the typical "This is how you make variables" lesson.

Python Functions

This is where you learn about the awesomeness that are functions. You see how you can use the variables you create to make reusable code that will benefit your program. If you are familiar with how to create functions I would still suggest that you go through this section if for nothing more than a refresher. I learned a few tricks myself that I had either forgotten about or weren't touched upon in previous courses and books I have gone through.

The project in this section is creating different functions to solve physics equations. I was not looking forward to this project as I haven't done any math like that since high school many years ago but once I started the project it was a really fun one. Creating functions to convert Fahrenheit into Celsius and vice versa was a lot of fun.

Python Control Flow

This section is about boolean values and how to use if statements to control the flow of the program. You are shown how to use the bool values True and False in Python. As well as shown how simple expressions can be read and created to equal these answers. Once you have a pretty firm grasp on them you are then tasked with putting them together inside of functions to make the function have some basic logic to answer certain questions.

The project in this section has you using variables and functions from the previous two sections as well as the control flow to create a program that will let a customer know what the cheapest way to ship a package would be. The project is a lot of fun and with the projects I have finished so far get you thinking about actual real world like scenarios of how to complete these tasks/challenges.

Conclusion

All in all I have been pretty impressed with the course so far. I am definitely looking forward to the next module. The Python section was a bit different from the SQL one as it had some additional quizzes and exercises to really re-enforce the learning in that section. So in each of these sections there is a quiz of multiple choices and then you get one or two extra challenges where you have to make some extra functions or variables to gain some more knowledge on how these concepts work. As always I hope you enjoy the read and I look forward to any questions and comments you have. Enjoy!

Latest comments (0)