Get up to 80 % extra points for free! More info:

Lesson 15 - Common Python Beginner Mistakes - Do You Make Them Too?

In the last lesson, Common Python beginner mistakes - Can you name variables?, we went through the most common beginner mistakes, when it comes to naming variables.

In today's Python tutorial, we'll slow down for a moment again and relax a bit. We'll show you what are the most common mistakes of Python programmers when using the knowledge we newly acquired, and how to avoid them. This will increase your seniority and value on the job market.

Word Of Senior Programmer

David Capka

I prepared the material for today's lesson, based on 20 years of programming experience. As an editor-in-chief and also a lecturer, hundreds, maybe thousands of source codes created by the community have passed through my hands. It was not difficult to notice that most of them, although working fine, contain unnecessary errors, which are also repeated over and over again. Surprisingly, mistakes were often made not only by beginner, but also by more experienced programmers - I used to do them too.

Correct Naming of Variables

We've covered proper identifier naming in the Lesson Common Python Beginner Mistakes - Can You Name Variables?, where we also explained why we should even deal with such things.

Naming Lists

We can now also declare lists, and naming lists is one of the biggest stumbling blocks in programming. There is a simple rule:

We always name collections in the plural form.

Again, of course, we follow the practice of naming a variable based on what's stored in the variable. And when there are multiple things, it should logically be plural.

Let's look at some wrong and correct examples of list declarations:


 

...End of the preview...
Continue further

You will gain knowledge worth hundreds of thousands for a few crowns

You've come here and that's great! We believe that the first lessons showed you something new and useful
Do you want to continue the course? Go to the premium section.

Buy this course

Buy all currently available lessons with exercise submitting and other features for just $5.40
Current account balance $0
By buying this package, you'll have access to all 21 articles (15 lessons, 6 practical exercises) in this course.

This article is licensed: Premium, by buying this article, you agree with the terms of use.

What will you get from us in the next lessons?
  • Unlimited and permanent access to individual lessons.
  • High quality IT knowledge.
  • Skills to help you get your dream and well-paid job.

Article description

Requested article covers this content:

In this Python lesson, we'll go through good practices regarding collections naming, bool expressions, DRY etc. and how they are frequently done wrong.

You gain credits by supporting our network. This is done by sending a helpful amount of money to support the site, or by creating content for the network.

Article has been written for you by Shift
Avatar
As an author I'm interested mainly in industry automation. I'm also writing music and literature. In my spare time I'm working on a few games in Game Maker Studio.
Activities