Get up to 40 % extra points for free! More info
Only this week sale up to 80 % on e-learning courses of Java

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

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.

Limited offer: Learn all knowledge and save money

Buy lessons and exercise submitting one by one 60 points
Buy all currently available lessons with exercise submitting and other features for an exclusive price 51 points ($4.59)
Currently, you have 0 points
By buying this exclusive package, you'll have access to all 21 lessons in this course including exercise submitting while saving $0.81. This offer is limited for the first lessons only with an additional exclusive 15% discount.
You gain 51 points for adding an article to the site, or for $5.40 $4.59

Warning, by buying just this lesson you'll lose the limited 15% discount for the package of all the lessons.

Buy only the lesson 10 points
Currently, you have 0 points
You gain 10 points for adding an article to the site, or for $0.90

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 points 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 (3)