Python
Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser.
Introduction (Python)
This webpage provides an introduction and basic knowledge of Python.
Beginning with Python Programming
(1) Finding an Interpreter
Before we start Python programming, we need to have an interpreter to interpret and execute our programs. There are some Softwares like Pycharm which can be used to run Python programs without installing an interpreter.
(2) Writing our First Program
Just type in the following code after you start the interpreter.Python
# Script Begins
print("SL Coding School")
# Scripts Ends
Output: The output will display on the console.
SL Coding SchoolLet’s analyze the script line by line.
Line 1: [# Script Begins]
In Python, comments begin with a #. This statement is ignored by the interpreter and serves as documentation for our code.
Line 2: [print("SL Coding School")]
To print something on the console, print() function is used. This function also adds a newline after our message is printed(unlike in C). Note that in Python 2, “print” is not a function but a keyword and therefore can be used without parentheses. However, in Python 3, it is a function and must be invoked with parentheses.
Line 3: [# Script Ends]
This is just another comment like in Line 1. Python designed by Guido van Rossum at CWI has become a widely used general-purpose, high-level programming language.
Reason for increasing popularity
- Emphasis on code readability, shorter codes, ease of writing
- Programmers can express logical concepts in fewer lines of code in comparison to languages such as C++ or Java.
- Python supports multiple programming paradigms, like object-oriented, imperative and functional programming or procedural.
- There exists inbuilt functions for almost all of the frequently used concepts.
- Philosophy is “Simplicity is the best”.
LANGUAGE FEATURES
- Interpreted
- There are no separate compilation and execution steps like C and C++.
- Directly run the program from the source code.
- Internally, Python converts the source code into an intermediate form called bytecodes which is then translated into native language of specific computer to run it.
- No need to worry about linking and loading with libraries, etc.
- Platform Independent
- Python programs can be developed and executed on multiple operating system platforms.
- Python can be used on Linux, Windows, Macintosh, Solaris and many more.
- Free and Open Source; Redistributable
- High-level Language
- In Python, no need to take care about low-level details such as managing the memory used by the program.
- Simple
- Closer to English language;Easy to Learn
- More emphasis on the solution to the problem rather than the syntax
- Embeddable
- Python can be used within C/C++ program to give scripting capabilities for the program’s users.
- Robust
- Exceptional handling features
- Memory management techniques in built
- Rich Library Support
- The Python Standard Library is very vast.
- Known as the “batteries included” philosophy of Python ;It can help do various things involving regular expressions, documentation generation, unit testing, threading, databases, web browsers, CGI, email, XML, HTML, WAV files, cryptography, GUI and many more.
- Besides the standard library, there are various other high-quality libraries such as the Python Imaging Library which is an amazingly simple image manipulation library.
Advantages
- Presence of third-party modules
- Extensive support libraries(NumPy for numerical calculations, Pandas for data analytics etc)
- Open source and community development
- Versatile, Easy to read, learn and write
- User-friendly data structures
- High-level language
- Dynamically typed language(No need to mention data type based on the value assigned, it takes data type)
- Object-oriented language
- Portable and Interactive
- Ideal for prototypes – provide more functionality with less coding
- Highly Efficient(Python’s clean object-oriented design provides enhanced process control, and the language is equipped with excellent text processing and integration capabilities, as well as its own unit testing framework, which makes it more efficient.)
- (IoT)Internet of Things Opportunities
- Interpreted Language
- Portable across Operating systems
Applications
- GUI based desktop applications
- Graphic design, image processing applications, Games, and Scientific/ computational Applications
- Web frameworks and applications
- Enterprise and Business applications
- Operating Systems
- Education
- Database Access
- Language Development
- Prototyping
- Software Development
Organizations using Python
- Google(Components of Google spider and Search Engine)
- Yahoo(Maps)
- YouTube
- Mozilla
- Dropbox
- Microsoft
- Cisco
- Spotify
- Quora
Note: Please note that Python for its scope doesn’t depend on the braces ( { } ), instead it uses indentation for its scope.