Top Ad unit 728 × 90

Libreoffice

Libreoffice Writer

Introduction of Python


Introduction of Python


Python is an interpreted object oriented high level programming language with dynamic semantics. Python Syntax is easy compared to other language .Python is a Free & open Source and Portable Language.


History of Python


·       👉 Python was introduced by Guido van Rossum in 1989 .


·    👉 First version of python in 1991 .


·    👉 In 1994 Python 1.0 was released with new features which map, filter and lambda.


·    👉 Python 2.x also add some more feature like comprehension garbage collection system .


·    👉 After Python 2.x Python 3.x released in 2008.


Features of Python


1. Easy to learn and implement


2. Open source


3. Extendable language


4. Expressive programming language 5.Board Standard library


6. Cross platform


7. Work on interpreter logic.


8. Multi paradigm language.


9. High level programming


10. GUI programming support.

               

Application of Python


·       👉 Network programming .


·   👉 Data analysis.


·   👉 Robotics .


·   👉 Website and application development .


·   👉 Desktop application game. 


·   👉 Development wave scrapping data. 


·   👉 Visualization scientific calculation. 


·   👉 Machine learning and artificial intelligence .


·   👉 3D applications development.


·   👉Audio and videos software development.


Fi      First Python Program-  

                                                  Print("Hello World")

                                                  

                                                  Output

                                                  Hello World


          Python Character Set


              Letter - A to Z, a to z


              Digits - 0 to 9 


              Special Symbols - +,-,*,/ Etc.


              Whitespaces - Blank Space, Tab, Carriage Return, Newline, Form feed

               

              Other Character - Python can Process all ASCII and Unicode Character as part of            

              data or literals.


          

            Variables

                      A variable is a name given to a memory location in a program.


                            Name ="Ad Computer Campus"   #string


                            Age =25  #Integer 


                           Price =45.67  # float

                           

                         Note :  Red Text is Variable and Blue Text is value.


                        Program 1


```                   Name="Ad computer campus"


                       Age= 25


                       Salary= 25000


                    Print("My name is :", Name)

P                  Print("My Age is: ", Age)

                    Print("My Salary is: ", Salary)


                   Output


                    My name is : Ad computer campus

P                  My Age is:  25

                    My Salary is: 25000



      Rules for Identifiers


1. Identifiers can be combination of uppercase and lowercase letters, digits or an underscore(_). So myVariable, variable_1, variable_for_print all are valid python identifiers.

2. An Identifier can not start with digit. So while variable1 is valid, 1variable is not valid.

3. We can't use special symbols like !,#,@,%,$ etc in our Identifier.

4. Identifier can be of any length.


Python keywords 

Python has a set of keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers:


KeywordDescription
andA logical operator
asTo create an alias
assertFor debugging
asyncDefine an asynchronous function
awaitWait for and get a result from an awaitable
breakTo break out of a loop
casePattern in a match statement
classTo define a class
continueTo continue to the next iteration of a loop
defTo define a function
delTo delete an object
elifUsed in conditional statements, same as else if
elseUsed in conditional statements
exceptUsed with exceptions, what to do when an exception occurs
FalseBoolean value, result of comparison operations
finallyUsed with exceptions, a block of code that will be executed no matter if there is an exception or not
forTo create a for loop
fromTo import specific parts of a module
globalTo declare a global variable
ifTo make a conditional statement
importTo import a module
inTo check if a value is present in a list, tuple, etc.
isTo test if two variables are equal
lambdaTo create an anonymous function
matchStart a match statement (compare a value against cases)
NoneRepresents a null value
nonlocalTo declare a non-local variable
notA logical operator
orA logical operator
passA null statement, a statement that will do nothing
raiseTo raise an exception
returnTo exit a function and return a value
TrueBoolean value, result of comparison operations
tryTo make a try...except statement
whileTo create a while loop
withUsed to simplify exception handling
yieldTo return a list of values from a generator




           





 

Introduction of Python Reviewed by ADcomputercampus on August 28, 2024 Rating: 5

No comments:

Contact Form

Name

Email *

Message *

Powered by Blogger.