class9_introduction_to_python
class9_introduction_to_python
Features of Python
1. Python is an open source, free programming language. Its code can be accessed ,modified and
distributed freely under flexible open source license.
2. Python is portable .it means that program developed in python run on all popular and advance
platforms such as Windows, Linux , Mac etc.
4. Python can be used as procedure oriented language as well as object oriented programming
language.
Modes of Python:-
Interactive Mode:- In interactive mode user keys in one command at a time and in response to that
command python shell execute the command and display the result.
Script Mode:- In script mode the python command are saved in a logical order to get the desired result.
The logical set of instruction is called script program.
Keywords:- Words that have special meaning are reserved by Python for special purpose and are not
allowed to be used as identifiers.
Idntifiers:- Identifiers are the user defines name of variable ,list ,dictionary, tuple ,classes etc.
Number:- int,flat,complex
SEQUENCE :- LIST,STRING,TUPLE
Maps:-Dictionary
Data Type Conversion:- Data is one of type can be converted into another type using type
conversion built in functions like int(),float(),str().
>>>float(12)
12.0
>>>int(15.7)
15
Types of Operators:-
Arithmetic Operator:-
Logical Operator:-
Assigment Operator:-
Types of error:-
Syntax Error:- Syntax means writing the code following the rule of python language.Syntax
error is occurred when we violating the rules of python language. There is typing error
,incorrect indentation or incorrect arguments given in a function then python will not be able to
interpret the instruction.
Logical Error:- This kind of error is difficult to find since the program will run correctly but the
desired output is not achieved.if we give a wrong formula but output is correct.
Run time Error:- Runtime error occurs during the execution f a program like wrong input or
output error,undefined objecterror ,division by zero.
a=10
b=0
c=a/b