Syntax & Fundamental Data Types in Python - 2 Updated
Syntax & Fundamental Data Types in Python - 2 Updated
Fundamenta
l data types
in python
M Shajitha Begum
Learning Objectives: Learning Outcomes:
1. Demonstrate
1. Basic syntax
knowledge of Python's
understanding
basic syntax rules.
2. Commenting mastery
2. Understand and use
fundamental data types 3. Variable declaration
such as integers, floats, 4. Statement formation
strings, and Boolean.
5. Data types
implementation
Big Question
In what scenarios would you choose to use
integers over floats or vice versa?
Pre Assessment
1. Which data type is suitable for representing numbers with
decimal points in Python?
a) Integer b) Float
2. How is a string enclosed in Python?
a) (“ “ ) b) " " c) ' ‘ d) [ ]
3. What happens if you try to use a Python keyword as a variable
name?
a) No effect, python allows it. b) A syntax error occurs
Pre Assessment
1. Which data type is suitable for representing numbers with
decimal points in Python?
a) Integer b) Float
2. How is a string enclosed in Python?
a) ( ) b) " " c) ' ‘ d) [ ]
3. What happens if you try to use a Python keyword as a variable
name?
a) No effect, python allows it. b) A syntax error occurs
Syntax in python
Syntax in python
1. Comments:
Use the # symbol for single-line comments.
Employ triple quotes (''' or """) for multi-line comments.
2. Indentation:
4. Variables:
6. Data Types:
Python supports various data types, including integers, floats, strings, booleans, lists, and more.
Variables should be assigned values of the appropriate data type.
7. Quotation Marks:
Strings can be defined using either single (') or double (") quotation marks.
Use a colon to indicate the beginning of a new block of code (e.g., in if statements, loops, and function
definitions).
Reflection
Identify the given examples of which
syntax.
TASKS