CODING WITH PYTHON
AGENDA
• Variables and datatypes
• Input() function
• Keywords
• List of keywords in python
• Expressions and Operators
VARIABLES
• Variables are storage locations used to
store value in the memory of a computer
• During processing, these values are
taken out from the memory and then
processed to generate output.
VARIABLES NAMING
CONVENTION
• A variable name can only start with an
alphabet or an (_) underscore sign.
• name can consist of digits (0-9), alphabets
and underscore.
• Variable name are case sensitive.
5
DATA TYPES
• Data types are labels that identify the
information stored in a variable.
1. INTEGER
2. FLOAT
3. STRING
4. BOOLEAN
NOTE:- type( ) function in Python helps in
identifying the data type of a variable, which is
useful for performing specific operations.
INPUT( ) FUNCTION 6
• Input ( ) function is sued to take input from the user.
• The input( ) function is used to fetch value from user
and store them in a variable.
• Int() is a function that converts a value to an integer,
and float( ) converts a value to a floating point
number (decimal)
• Syntax:- int(input(“enter a number”))
KEYWORD
• When we use English language each word has its
own meaning, similarly keywords are the reserved
word that has some specific work and meaning to a
python language which is understood by the
interpreter.
• It cannot be used as a identifier name (variable
name)
EXPRESSION 7
An expression can be defined
as statement that consist of
variable, values and operators.
Eg: a=20
b=40
8
Types of
OPERATORS operators:-
Operators are the 1. Arithmetic operator
symbols that perform 2. Relational operator
some specific
3. Logical operator
operation on variables
and give meaningful 4. Assignment
result. operators