Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Comments | First Acquaintance
Introduction to Python 2022

bookComments

Comments in programming are parts of code that Python ignores. The primary purpose of using them is readability. It is a good practice to leave comments in your code with descriptions of what a particular part of code does.

In Python, the comment starts with the hash # sign. All the text right to the # will be ignored. For example, you may have two print() functions, but if you place # to the left of one of them, then only one string will be output.

12
print('String 1') #print('String 2')
copy
question mark

How many lines will be printed after the code execution?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Spørg mig spørgsmål om dette emne

Opsummér dette kapitel

Vis virkelige eksempler

Awesome!

Completion rate improved to 20

bookComments

Stryg for at vise menuen

Comments in programming are parts of code that Python ignores. The primary purpose of using them is readability. It is a good practice to leave comments in your code with descriptions of what a particular part of code does.

In Python, the comment starts with the hash # sign. All the text right to the # will be ignored. For example, you may have two print() functions, but if you place # to the left of one of them, then only one string will be output.

12
print('String 1') #print('String 2')
copy
question mark

How many lines will be printed after the code execution?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4
some-alt