INTRODUCTION TO PYTHON
(Part 2)
OPERATORS
Operators are special symbols that can be used to perform one or more
operands.
Operands: the values on which operations are performed.
Expression: a combination of operations and operand is known ad
expression.
OPERATORS
Arithmetic operators Relation operators Logical operators Assignment operators
Used to perform basic Used to compare 2 Used to compare 2 or Assignment operators
mathematical values (also known as more Boolean are symbols in Python
operations comparison operators expression (and AI coding) used to
assign values to
variables.
Note: refer pg 232 to 234
INPUT AND OUTPUT FUNCTION IN PYTHON
The input() function is used to take input from the user. It accepts the input
from the CONSOLE. The input() function takes one string argument.
Eg: num= input (“Enter your name”)
Print (num)
- THE PRINT FUCTION:
The print function prints a value or a message.
It converts message into a string.
It can have multiple parameters.
- THE INPUT FUNCTION:
It is used to take input from the user.
The input function takes one string argument
We need to use int()
Note: refer pg no: 236
TYPE CONVERSION:
- The process of converting the value of one data type to another is
called TYPE CONVERSION.
- Python supports 2 conversion:
- EXPLICIT TYPE CONVERSION
- IMPLICIT TYPE CONVERSION.