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
Python has a set of keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers:
| Keyword | Description |
|---|---|
| and | A logical operator |
| as | To create an alias |
| assert | For debugging |
| async | Define an asynchronous function |
| await | Wait for and get a result from an awaitable |
| break | To break out of a loop |
| case | Pattern in a match statement |
| class | To define a class |
| continue | To continue to the next iteration of a loop |
| def | To define a function |
| del | To delete an object |
| elif | Used in conditional statements, same as else if |
| else | Used in conditional statements |
| except | Used with exceptions, what to do when an exception occurs |
| False | Boolean value, result of comparison operations |
| finally | Used with exceptions, a block of code that will be executed no matter if there is an exception or not |
| for | To create a for loop |
| from | To import specific parts of a module |
| global | To declare a global variable |
| if | To make a conditional statement |
| import | To import a module |
| in | To check if a value is present in a list, tuple, etc. |
| is | To test if two variables are equal |
| lambda | To create an anonymous function |
| match | Start a match statement (compare a value against cases) |
| None | Represents a null value |
| nonlocal | To declare a non-local variable |
| not | A logical operator |
| or | A logical operator |
| pass | A null statement, a statement that will do nothing |
| raise | To raise an exception |
| return | To exit a function and return a value |
| True | Boolean value, result of comparison operations |
| try | To make a try...except statement |
| while | To create a while loop |
| with | Used to simplify exception handling |
| yield | To return a list of values from a generator |
Reviewed by ADcomputercampus
on
August 28, 2024
Rating:
.jpeg)

No comments: