Python Tutor here. I’ve worked with several students with zero programming experience and helped them learn Python from scratch — this has since given me some insight on the order in which we should learn different topics and concepts in Python!
Note: What comes next is a roadmap — an…
So you’re planning to get started with programming, and are torn between choosing Python or Java. As someone who started with Python, but have worked with both languages (Java for work and Python for personal projects), here are some differences between the 2 as well as some pros and cons:
If you’re taking a class or course on Python, chances are that you need to deal with lists one way or another. Here’s a cheatsheet of useful list functions that may come in handy if you’re taking a Python test
To create a list in Python, we need to use…
If you’ve worked with Python for a while, chances are that you’re pretty familiar with functions and the return keyword. But just in case you’re not too clear, here’s how it works in a nutshell
def add(a, b):
return a + b
This function takes in 2 arguments
I’ve tutored quite a couple of students (both regular and ad-hoc) on Pandas and data analytics, and have noticed that not many people are too familiar with the pandas groupby function.
Let’s say we know of a couple of fruit shops — A, B and C — and each shop…
Let’s say we have a multi-level directory full of files that we want to analyze.
|- 2.txt |- B
|- 3.txt |- C
These can be images, audio files, CSV files, or whatever you wish to analyze, but for demonstration purposes here, I’ll…
If you clicked on this article, I’m guessing that you’re pretty new to Python, and are confused about how this slicing stuff works. Without further ado, here it is — string slicing explained in simple english!
Let’s say we have a string
letters = "abcdefg"
Strings are ordered —…
If you’ve ever done programming in a team, you’ve probably used version control tools like github or bitbucket, and will probably use them if you haven’t! Here are some commands that I find pretty useful if things go south when using git.
This command allows us to view…
If you’re taking a course on Python in school or wherever, there is a moderate chance that you might be asked to implement code to generate permutations from a given list from scratch without using libraries e.g., itertools. Here is a simple recursive implementation to generate permutations for your understanding!
If you clicked on this article, chances are that you’re new to for loops, and have trouble understanding the
range function and how it works.
for i in range(5):
range function is often used together with a for loop. This prints: