Python (programming language)

From Simple English Wikipedia, the free encyclopedia
Python (programming language)
Python-logo-notext.svg
ParadigmMulti-paradigm: object-oriented,[1] procedural (imperative), functional, structured, reflective
Designed byGuido van Rossum
DeveloperPython Software Foundation
First appeared20 February 1991; 31 years ago (1991-02-20)[2]
Stable release3.11.0[3] Edit this on Wikidata / 24 October 2022; 23 days ago (24 October 2022)
Preview release3.12.0a2[4] Edit this on Wikidata / 15 November 2022; 1 day ago (15 November 2022)
Typing disciplineDuck, dynamic, strong typing;[5] gradual (since 3.5, but ignored in CPython)[6]
OSWindows, Linux/UNIX, macOS and more[7]
LicensePython Software Foundation License
Filename extensions.py, .pyi, .pyc, .pyd, .pyo (prior to 3.5),[8] .pyw, .pyz (since 3.5)[9]
Websitewww.python.org
Major implementations
CPython, PyPy, Stackless Python, MicroPython, CircuitPython, IronPython, Jython
Dialects
Cython, RPython, Starlark[10]
Influenced by
ABC,[11] Ada,[12] ALGOL 68,[13] APL,[14] C,[15] C++,[16] CLU,[17] Dylan,[18] Haskell,[19] Icon,[20] Java,[21] Lisp,[22] Modula-3,[16] Perl, Standard ML[14]
Influenced
Apache Groovy, Boo, Cobra, CoffeeScript,[23] D, F#, Genie,[24] Go, JavaScript,[25][26] Julia,[27] Nim, Ring,[28] Ruby,[29] Swift[30]

Python is an open source programming language. It was made to be easy-to-read-and-understand and powerful. A Dutch programmer named Guido van Rossum made Python in 1991. He named it after the television program Monty Python's Flying Circus. Many Python examples and tutorials include jokes from the show.[31]

Python is an interpreted language. Interpreted languages do not need to be compiled to run. A program called an interpreter runs Python code on almost any kind of computer. This means that a programmer can change the code and quickly see the results. This also means Python is slower than a compiled language like C, because it is not machine code directly.

Python has become one of the most famous programming languages on the world as of late. It's utilized in all that from AI to building sites and programming testing. It tends to be utilized by engineers and non-designers the same.

Python drew inspiration from other programming languages like C, C++, Java, Perl, and Lisp.

Python's developers try to avoid changing the language to make it better until they have a lot of things to change. Also, they try not to make small repairs, called patches, to unimportant parts of the CPython reference implementation that would make it faster. When speed is important, a Python programmer can move some of the work of the program to other parts written in programming languages like C or PyPy, a just-in-time compiler. It translates a Python script into C and makes direct C-level API calls into the Python interpreter.

Keeping Python fun to use is an important goal of Python’s developers. It reflects in the language's name, a tribute to the British comedy group Monty Python. On occasions, there are playful approaches to tutorials and reference materials, such as referring to spam and eggs instead of the standard foo and bar.

Python use[change | change source]

Python is usually utilized for creating sites and programming, task robotization, information investigation, and information representation. Since it's moderately simple to learn, Python has been taken on by numerous non-software engineers like bookkeepers and researchers, for different regular undertakings, such as coordinating funds.

Its standard library is made up of many functions that come with Python when it is installed.[32] On the Internet there are many other libraries available that make it possible for the Python language to do more things. These libraries make it a powerful language; it can do many different things.

For what reason is Python so Popular?[change | change source]

1) Easy to Learn and Use[change | change source]

Python language is unimaginably simple to utilize and learn for new amateurs and rookies. The python language is one of the most open programming languages accessible in light of the fact that it has worked on linguistic structure and not muddled, which gives more accentuation on normal language. Because of its simplicity of learning and utilization, python codes can be effectively composed and executed a lot quicker than other programming languages.

2) Experienced and Supportive Python Community[change | change source]

Python was made over quite a while back, which is a ton of time for any local area of programming language to develop and develop enough to help engineers going from novice to master levels. There are a lot of documentation, guides and Video Tutorials for Python language that are accessible that student and engineer of any expertise level or ages can utilize and get the help expected to improve their insight in the python programming language.

3) Support from Renowned Corporate Sponsors[change | change source]

Programming languages develops quicker when a corporate support backs it. For instance, PHP is supported by Facebook, Java by Oracle and Sun, Visual Basic and C# by Microsoft. Python Programming language is intensely upheld by Facebook, Amazon Web Services, and particularly Google.

4) Many Python Libraries and Frameworks[change | change source]

Because of its corporate sponsorship and huge steady local area of python, python has amazing libraries that you can use to choose and save your time and exertion on the underlying pattern of improvement. There are additionally heaps of cloud media benefits that get stage support through library-like apparatuses, which can be very gainful.

5) Adaptability, Efficiency, Reliability, and Speed[change | change source]

Ask any python engineer, and they will earnestly concur that the python language is proficient, solid, and a lot quicker than most current languages. Python can be utilized in almost any sort of climate, and one won't confront any sort of presentation misfortune regardless of the stage one is working.

How could you at any point manage python? A few things include[change | change source]

Syntax[change | change source]

Some of Python's syntax comes from C, because that is the language that Python was written in. But Python uses whitespace to delimit code: spaces or tabs are used to organize code into groups. This is different from C. In C, there is a semicolon at the end of each line and curly braces ({}) are used to group code. Using whitespace to delimit code makes Python a very easy-to-read language.

Statements and control flow[change | change source]

Python's statements include:

  • The assignment statement, or the = sign. In Python, the statement x = 2 means that the name x is bound to the integer 2. Names can be rebound to many different types in Python, which is why Python is a dynamically typed language. For example, you could now type the statement x = 'spam' and it would work, but it wouldn't in another language like C or C++.
  • The if statement, which runs a block of code if certain conditions are met, along with else and elif (a contraction of else if from other programming languages). The elif statement runs a block of code if the previous conditions are not met, but the conditions for the elif statement are met. The else statement runs a block of code if none of the previous conditions are met.
  • The for statement, which iterates over an iterable object such as a list and binds each element of that object to a variable to use in that block of code, which creates a for loop.
  • The while statement, which runs a block of code as long as certain conditions are met, which creates a while loop.
  • The def statement, which defines a function or method.
  • The pass statement, which means "do nothing."
  • The class statement, which allows the user to create their own type of objects like what integers and strings are.
  • The import statement, which imports Python files for use in the user's code.
  • The print statement, which outputs various things to the console.

Expressions[change | change source]

Python's expressions include some that are similar to other programming languages and others that are not.

  • Addition, subtraction, multiplication, and division, represented by +, -. *, and /.
  • Exponents, represented by **.
  • To compare two values, Python uses ==.
  • Python uses the words "and", "or", and "not" for its boolean expressions.

Example[change | change source]

This is a small example of a Python program. It shows "Hello World!" on the screen.

print("Hello World!")

# This code does the same thing, only it is longer:

ready = True
if ready:
    print("Hello World!")

Python also does something called "dynamic variable assignment". This means that when a number or word is made in a program, the user does not have to say what type it is. This makes it easier to reuse variable names, making fast changes simpler. An example of this is shown below. This code will make both a number and a word, and show them both, using only one variable.

x = 1
print(x)
x = "Word"
print(x)

In a "statically typed" language like C, a programmer would have to say whether x was a number or a word before C would let the programmer set up x, and after that, C would not allow its type to change from a number to a word.

References[change | change source]

  1. "General Python FAQ — Python 3.9.2 documentation". docs.python.org. Archived from the original on 24 October 2012. Retrieved 2021-03-28.
  2. "Python 0.9.1 part 01/21". alt.sources archives. Archived from the original on 11 August 2021. Retrieved 2021-08-11.
  3. "Python 3.11 Released With Big Performance Improvements, Task Groups For Async I/O"; retrieved: 25 October 2022; publication date: 24 October 2022; house publication: Phoronix.
  4. "Python 3.12.0 alpha 2 released". 15 November 2022. Retrieved 16 November 2022.
  5. "Why is Python a dynamic language and also a strongly typed language - Python Wiki". wiki.python.org. Archived from the original on 14 March 2021. Retrieved 2021-01-27.
  6. "PEP 483 -- The Theory of Type Hints". Python.org. Archived from the original on 14 June 2020. Retrieved 14 June 2018.
  7. "Download Python". Python.org. Archived from the original on 8 August 2018. Retrieved 2021-05-24.
  8. File extension .pyo was removed in Python 3.5. See PEP 0488 Archived 1 June 2020 at the Wayback Machine
  9. Holth, Moore (30 March 2014). "PEP 0441 -- Improving Python ZIP Application Support". Archived from the original on 26 December 2018. Retrieved 12 November 2015.
  10. "Starlark Language". Archived from the original on 15 June 2020. Retrieved 25 May 2019.
  11. "Why was Python created in the first place?". General Python FAQ. Python Software Foundation. Archived from the original on 24 October 2012. Retrieved 22 March 2007.
  12. "Ada 83 Reference Manual (raise statement)". Archived from the original on 22 October 2019. Retrieved 7 January 2020.
  13. Kuchling, Andrew M. (22 December 2006). "Interview with Guido van Rossum (July 1998)". amk.ca. Archived from the original on 1 May 2007. Retrieved 12 March 2012.
  14. 14.0 14.1 "itertools — Functions creating iterators for efficient looping — Python 3.7.1 documentation". docs.python.org. Archived from the original on 14 June 2020. Retrieved 22 November 2016.
  15. van Rossum, Guido (1993). "An Introduction to Python for UNIX/C Programmers". Proceedings of the NLUUG Najaarsconferentie (Dutch UNIX Users Group). CiteSeerX 10.1.1.38.2023. even though the design of C is far from ideal, its influence on Python is considerable.
  16. 16.0 16.1 "Classes". The Python Tutorial. Python Software Foundation. Archived from the original on 23 October 2012. Retrieved 20 February 2012. It is a mixture of the class mechanisms found in C++ and Modula-3
  17. Lundh, Fredrik. "Call By Object". effbot.org. Archived from the original on 23 November 2019. Retrieved 21 November 2017. replace "CLU" with "Python", "record" with "instance", and "procedure" with "function or method", and you get a pretty accurate description of Python's object model.
  18. Simionato, Michele. "The Python 2.3 Method Resolution Order". Python Software Foundation. Archived from the original on 20 August 2020. Retrieved 29 July 2014. The C3 method itself has nothing to do with Python, since it was invented by people working on Dylan and it is described in a paper intended for lispers
  19. Kuchling, A. M. "Functional Programming HOWTO". Python v2.7.2 documentation. Python Software Foundation. Archived from the original on 24 October 2012. Retrieved 9 February 2012.
  20. Schemenauer, Neil; Peters, Tim; Hetland, Magnus Lie (18 May 2001). "PEP 255 – Simple Generators". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 5 June 2020. Retrieved 9 February 2012.
  21. Smith, Kevin D.; Jewett, Jim J.; Montanaro, Skip; Baxter, Anthony (2 September 2004). "PEP 318 – Decorators for Functions and Methods". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 3 June 2020. Retrieved 24 February 2012.
  22. "More Control Flow Tools". Python 3 documentation. Python Software Foundation. Archived from the original on 4 June 2016. Retrieved 24 July 2015.
  23. "CoffeeScript". coffeescript.org. Archived from the original on 12 June 2020. Retrieved 3 July 2018.
  24. "The Genie Programming Language Tutorial". Archived from the original on 1 June 2020. Retrieved 28 February 2020.
  25. "Perl and Python influences in JavaScript". www.2ality.com. 24 February 2013. Archived from the original on 26 December 2018. Retrieved 15 May 2015.
  26. Rauschmayer, Axel. "Chapter 3: The Nature of JavaScript; Influences". O'Reilly, Speaking JavaScript. Archived from the original on 26 December 2018. Retrieved 15 May 2015.
  27. "Why We Created Julia". Julia website. February 2012. Archived from the original on 2 May 2020. Retrieved 5 June 2014. We want something as usable for general programming as Python [...]
  28. Ring Team (4 December 2017). "Ring and other languages". ring-lang.net. ring-lang. Archived from the original on 25 December 2018. Retrieved 4 December 2017.
  29. Bini, Ola (2007). Practical JRuby on Rails Web 2.0 Projects: bringing Ruby on Rails to the Java platform. Berkeley: APress. p. 3. ISBN 978-1-59059-881-8.
  30. Lattner, Chris (3 June 2014). "Chris Lattner's Homepage". Chris Lattner. Archived from the original on 25 December 2018. Retrieved 3 June 2014. The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
  31. "Python Humor". Python.org. Retrieved 2020-09-19.
  32. "Python Coding | Data Basecamp". 2021-11-27. Retrieved 2022-08-29.

Other websites[change | change source]