Module 1 - Python Basics Flashcards
The purpose of this deck is to familiarize the student with the basics of Python syntax.
These are the set of rules that are used to create a Python program.
Python Syntax
It is a name used to identify a variable, function, class, module, or other object.
Identifier
True or False: Uppercase and lowercase letters are allowed in an identifier.
True
True or False: Numbers are allowed in an identifier.
True
True or False: Underscores are not allowed in an identifier.
False (Underscores are allowed in a Python identifier)
True or False: Symbols and special characters are allowed in an identifier.
False (Special characters are not allowed in an identifier.)
True or False: Python class names start with a capital letter.
True
Starting an identifier with a single leading underscore indicates that the identifier is a __________.
Private Identifier
A strongly private identifier starts with what?
Two leading underscores.
If the identifier ends with two trailing underscores, what is it called?
A language-defined special name.
These specific words are reserved and cannot be used in an identifier or variable name.
Python Keywords.
True or False: Python keywords start with an uppercase letter.
False (Python keywords start with a lowercase letter.)
What is used to denote a block of code?
Line Indentation
What symbol is used to denote a line continuation in Python?
\ (Backslash)
What statements do not need the use of the backslash?
[], {}, and ().
(Brackets, braces, and parentheses.)