GoConqr has a new look! Let us know what you think.

Module 2 of 3 · Text

LAB

David Khieu

LAB

Objectives

  • becoming familiar with the concept of comments in Python
  • using and not using comments
  • replacing comments with code
  • experimenting with Python code

Scenario

The code in the editor contains comments. Try to improve it: add or remove comments where you find it appropriate (yes, sometimes removing a comment can make the code more readable), and change variable names where you think this will improve code comprehension. 

NOTE

Comments are very important. They are used not only to make your programs easier to understand, but also to disable those pieces of code that are currently not needed (e.g., when you need to test some parts of your code only, and ignore other). Good programmers describe each important piece of code, and give self-commenting names to variables, as sometimes it is simply much better to leave information in the code.

It's good to use readable variable names, and sometimes it's better to divide your code into named pieces (e.g., functions). In some situations, it's a good idea to write steps of computations in a clearer way. 

One more thing: it may happen that a comment contains a wrong or incorrect piece of information - you should never do that on purpose! 

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?