Search Header Logo
W2-L1-Comments-in-Python-Programming

W2-L1-Comments-in-Python-Programming

Assessment

Presentation

Computers

6th Grade

Hard

Created by

Hatoof ATS

Used 3+ times

FREE Resource

7 Slides • 6 Questions

1

media

Comments and
Variables in Python

In this lesson, we'll explore the essential concepts of comments and

variables in Python programming, which are crucial for writing clear and

organized code.

by Hatoof Ababneh

2

media

Warm Up Activity: Guessing Game

Instructions

Think of a number between 1 and

10. Your partner will try to guess

your number.

Rules

You can only say "higher" or

"lower" after each guess.

Goal

See who can guess the number in

the fewest tries!

3

media

What are Comments?

Definition

Comments are notes within your code that are ignored by

the computer. They're meant for humans to understand the

code better.

# This is a comment

print("Hello, world!")

Example

4

5

media

Importance of
Comments

Clarity

Comments help explain what

your code does, making it

easier to understand.

Organization

They can break down complex

code into smaller, more

manageable sections.

Collaboration

Comments make it easier for others to work on your code or

understand your logic.

6

media

Comment Syntax in Python

Hash Symbol

Start a comment with a '#' symbol. Everything after the '#' on

the same line is a comment.

Multiline Comments

For multiline comments, use triple quotes ('''comment here''')

7

media

Lets take a quick QUIZ

8

Multiple Choice

Which of the following lines of code are correct?

1

Print('Hello world!')

2

print('Hello world!')

3

print(Hello world!)

4

print 'Hello world!'

9

Multiple Select

What is the purpose of comments in Python code?

1

To explain the code

2

To make the code more readable

3

To prevent execution when testing code

4

All of the above

10

Multiple Choice

How can multi-line comments be added in Python?

1

By using the # symbol for each line

2

By using triple quotes (""")

3

By using the // symbol at the beginning of each line

4

By using the /* */ symbols

11

Multiple Select

Which of the following is true about comments

1

Comments are used by programmers to document the code

2

# is used to create a comment in python

3

''' can be used to create a comment in python

4

/* */ can be used to crate a comment in python

5

Python ignores comments.

12

Multiple Choice

a line of text that Python won't try to run as code
1
comment
2
modulo
3
variable
4
boolean

13

Multiple Choice

surrounds multi-line comments
1
"""
2
**
3
#
4
%
media

Comments and
Variables in Python

In this lesson, we'll explore the essential concepts of comments and

variables in Python programming, which are crucial for writing clear and

organized code.

by Hatoof Ababneh

Show answer

Auto Play

Slide 1 / 13

SLIDE