Python is a great programming language to learn for anyone in data profession. For people with prior Excel skills and a little bit of programming bent, Python is a valuable skill to acquire. Using Python, we can:
- Automate data collection, clean-up and manipulation
- Create machine learning models, complex data analysis systems
- Produce interesting and advanced data visualizations
- Make interactive windows applications & websites
- Or just have fun learning and solving problems
Python & me
One of my learning goals for 2022 has been to learn Python. I have been learning how to write Python code and use Python to solve real-world problems since January 2022. In fact, all of us: Jo(wife), Nishanth(son) & Nakshatra(daughter) have been learning Python every week for the last few months.
So in this article, let me share some resources on how to learn Python (for an Excel person).
Learning Python: Getting started
The first step is to download Python & set up a coding environment.
- Download latest version of Python
- Follow the instructions on the download page to install Python on your computer.
Set-up a coding environment:
Once Python is installed, you may want to also set-up a coding environment. This allows you to write code, execute, debug & manage files with ease.
- I have been using the excellent Visual Studio Code by Microsoft.
- You can download and install Visual Studio Code (VS Code for short) from here.
Your first program
Writing a hello world program is the sacred ritual in software development. To create a simple python program that prints the message hello world use below code:
Hello World v2.0
You can easily enhance that code to ask the user for their name first and then print a hello message.
For that, you can use the input() function in Python, like this:
name = input("What is your name? ") print("Hello " + name+ ", This is my first Python program")
Going beyond: 1+ hour Python Tutorial
I just posted a 1+ hour video on how to write Python code with many examples & 3 projects on my YouTube channel. So if you want to learn a bit more about Python coding, please watch it below or on my channel.
The video covers below topics in detail.
- Getting started with Python
- Working with variables in Python
- IF condition, indentation in Python
- While loop in Python
- Building a simple expense calculator with Python
- Working with Lists in Python
- Using For loop when navigating a list
- Generating list of values with loops
- List comprehension in Python
- How to access an item or a part of list in Python
- Creating a multiplication table with Python lists
- Building an enhanced expense calculator with Python
- Working with CSV & Datetime libraries in Python
- How to execute Python code from command line
- How to learn more – My top 6 tips
Sample Files 👨🏾💻👩🏾💻
As part of the above video, I build many Python examples & 3 mini-projects.
The code samples:
- hello.py: Hello world
- agecheck.py: Age check program
- expensecalc.py: Simple expense calculator
- lists.py: Working with lists
- multiplication-table.py: Working with lists & list comprehensions
- expensecalc2.py: Improved expenses calculator
- trackerproject.py: Expense tracker app with Python
Learn more - Python Resources
As I said earlier, Python is a fun and useful language to learn. If you like a bit of challenge, I highly recommend learning Python. Here are a few of my favorite resources to learn & use Python.
- Visual Studio Code for building and managing Python files
- Python Crash Course 2nd Edition by Eric Matthes: This is the book we all (Jo, kids & I) read and really loved it. The explanations and examples are easy enough to get started. There is enough variety to please everyone. Pictured aside is my son with the book 🙂
- Automate boring stuff with Python: More practical if you want to get things done with Python. I read it a few times and really like the practicality of the book.
- Python Data Science Handbook: Python is particularly useful for doing data science & building machine learning models. This is an area of focus for me in the next months. I suggest getting the Python Data Science book once you have strong foundation in the language.
Python related Channels:
Youtube is another popular way to learn Python coding. Here is another excellent getting started tutorial:
I recommend Coding 101: Python for Beginners by Alvin Wan on SkillShare. It is a concise and practical course that should give you enough confidence to build more powerful code. Check out the class here (you get 1 month free access to SkillShare when you join with my link).
Wish you all the best 👍
Note: If you purchase the course or books using my links, I receive a small commission. My recommendation is based purely on the merit of them rather than the payout.
Do you code in Python? Tell me more...
Using the comments below, Do let me know what you use Python for and how you make it part of your work / personal life projects.