Python is a general purpose, dynamic, high-level, and interpreted programming language. It supports Object Oriented programming approach to develop applications. It is simple and easy to learn and provides lots of high-level data structures.
1. Python is an open source, object-oriented, high-level powerful programming language.
2. Developed by Guido van Rossum in the early 1990s. Named after Monty Python
3. Python runs on many UNIX variants, on the Mac, and on Windows 2000 and later.
4. Available for download from http://www.python.org.
Python is a high-level, general-purpose, interpreted programming language
Python is a high-level programming language that makes it easy to learn. Python doesn’t require you to understand the details of the computer in order to develop programs efficiently.
Python is a general-purpose language. It means that you can use Python in various domains including:
- Web applications
- Big data applications
- Data science, machine learning, and AI
- Desktop software
- Mobile apps
- The targeted language like SQL which can be used for querying data from relational databases.
Python is an interpreted language. To develop a Python program, you write Python code into a file called source code.
To execute the source code, you need to convert it to the machine language that the computer can understand. And the Python interpreter turns the source code, line by line, once at a time, into the machine code when the Python program executes.
Compiled languages like Java and C# use a compiler that compiles the whole source code before the program executes.
Interpreters usually take less amount of time to analyze the source code. However, the overall execution time is comparatively slower than compilers.
No Object Code is generated, hence are memory efficient.
Program, to print hello world in python
- Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.
It is used for:
- web development (server-side),
- software development,
- System scripting.
Variables are containers for storing data values.
x = 5
y = "John" //here x and y is a type of variable
Assigning Values to Variables
Python variables do not need explicit declaration to reserve memory space. The declaration happens automatically when you assign a value to a variable. The equal sign (=) is used to assign values to variables.
||Here x store the value 22 so x is the variable
Rules for naming a variable are as follows –
- The variable name should either begin with an Uppercase(A to Z) or Lowercase(a to z) character or an underscore(_).
- One should always remember to use a meaningful name for variables in Python. For example – no_of_chocolates makes more sense than noc.
- Which brings us to the next point. If a variable has multiple words, it is advised to separate them with an underscore.
- One should ensure that a variable name should not be similar to keywords of the programming language.
- One should also remember that even variable names are case-sensitive.
- A variable should not begin with a digit or contain any white spaces or special characters such as #,@,&.
- Example of good variable names – my_name, my_dob.
- Example of bad variable names – #n, 22dob.