0% found this document useful (0 votes)
3 views10 pages

Day 02 Understanding Python Syntax

The document covers essential Python syntax topics including identifiers, execution methods, indentation, variables, and comments. It explains that identifiers are user-defined names, indentation is crucial for code blocks, and comments can be single or multi-line. Additionally, it includes quiz questions to reinforce understanding of these concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

Day 02 Understanding Python Syntax

The document covers essential Python syntax topics including identifiers, execution methods, indentation, variables, and comments. It explains that identifiers are user-defined names, indentation is crucial for code blocks, and comments can be single or multi-line. Additionally, it includes quiz questions to reinforce understanding of these concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Syntax

what you’ll learn:

• Python Identifiers
• Execute Python Syntax
• Python Indentation
• Python Variables
• Comments in Python
Python Identifiers

Identifiers in Python are user defined names to


represent variable, functions, class or any
object or module.
Execute Python Syntax

Python syntax can be executed by writing directly in


the Command Line or by creating a python file on the
server, using the .py file extension, and running it in
the Command Line
Python Indentation

In other programming languages the indentation


Indentation refers to the spaces at the in code is for readability only, the indentation in
beginning of a code line Python is very important.
Python uses indentation to indicate a block of
code.

Python will give you an error if you skip the


indentation
Python Variables

In Python, variables are created when you


assign a value to it

Python has no command for declaring a


variable.
Comments In Python

Comments can be single line or multi line.


Python has commenting capability for Single line comments are denoted by
the purpose of in-code documentation. ‘#’,and Python will render rest of the line
as a comment.
Multiline comments are denoted by ‘’’ or
“””.
Comments are non-executable
instructions/statements ignored by the
interpreter.
AUGMINTECH

Q1. Identifiers in Python is a name given to ___________?

(a) Variables (b) Functions


(c) Modules (d) All the Above

Ans: (d) All the above


AUGMINTECH

Q2. Comments in Python are written using ___________?

(a) # (b) ‘’’ ‘’’


(c) “”” “”” (d) All the Above

Ans: (d) All the above


AUGMINTECH

Q3. ___________ is a container to store the value

(a) Function (b) Variable


(c) Class (d) Comment

Ans: (b) Variable


AUGMINTECH

Q4. Python file is saved with ___________ extension.

(a) .py extension (b) .txt extension


(c) .python extension (d) None of the above

Ans: (a) .py extension

You might also like