Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Comments | Python Basics
Introduction to Python | Mobile-Friendly
course content

Kursusindhold

Introduction to Python | Mobile-Friendly

Introduction to Python | Mobile-Friendly

1. Python Basics
2. Variables
3. Strings

book
Comments

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

In Python, the comment starts with the hash # sign. All the text to the right of 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 text will be outputted.

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

What symbol is used in Python to comment out?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 2

Spørg AI

expand
ChatGPT

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

course content

Kursusindhold

Introduction to Python | Mobile-Friendly

Introduction to Python | Mobile-Friendly

1. Python Basics
2. Variables
3. Strings

book
Comments

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

In Python, the comment starts with the hash # sign. All the text to the right of 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 text will be outputted.

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

What symbol is used in Python to comment out?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 2
Vi beklager, at noget gik galt. Hvad skete der?
some-alt