2. DATA TYPES
• Data Types define the type of value a
variable can store and can perform
operations on.
• Example :
A variable with data type as int
will store only integer type values and
not decimal or String values.
4. OPERATORS
•Operators are special symbols that
are used to perform operations on
variables (or even literals).
•The values on which they perform
operations are called operands.
6. EXPRESSIONS
An expression is defined as a combination of
constants, variables, and operators. An
expression always evaluates to a value. A
value or a standalone variable is also
considered as an expression but a
standalone operator is not an expression.
Example:
(i) 100 (ii) num (iii) "Global" + "Citizen"
(iv) 3.0 + 3.14 (v) 23/3 -5 * 7(14 -
2)
7. STATEMENT
A statement is a unit of code that the
Python interpreter can execute.
This can be an assignment statement,
a print statement, etc.
Eg-
• print(“This is a print statement.”)
• a=5
print(a)
8. INPUT
Input in Python can be done by using the
input() function, that prompts the user
to enter an input. The input is always
treated as a String, but can be later
converted into the desired data type
using Type Conversion.
Eg-
input(“Enter the number you want to
store in a:”)
9. OUTPUT
Output in Python can be done by using the
print() function that prints the
statement or value or result of an
expression that is written in
parenthesis.
Eg-
print(“This is an example of a print
statement.”)
10. DEBUGGING
Debugging is the process of removing any
mistake or error in the program code.
These can be Syntax errors (when the
syntax is not followed properly), or
Logical errors (when there is an error in
the program logic; these are not
detected by the Python interpreter) or
Runtime errors (where the program may
run but doesn’t give the expected
output.
11. TYPE CONVERSION
Type Conversion is the process of converting
one data type to another data type, either
by user intervention (Explicit) or
automatically by the Python interpreter
(Implicit).
Eg-
Implicit—a=10;b=2.0
print(a+b) #output is in float-12.0
Explicit—a= int(“56”)
print(a) #output will be integer type a