Python (programming language) facts for kids
![]() |
|
Designed by | Guido van Rossum |
---|---|
Stable release |
3.5.2 /
June 27, 2016 2.7.12 / June 25, 2016 |
Platform | Any |
OS | Any |
License | Python License |
Filename extensions | .py, .pyo, .pyc |
Website | https://www.python.org |
Python is a popular open source programming language. It was designed to be easy to read and understand. A computer programmer named Guido van Rossum created it in 1991. Python got its name from the funny TV show Monty Python's Flying Circus. You might even find jokes from the show in some Python examples!
Python is an interpreted language. This means you don't need to turn the code into a special computer language first. Instead, a program called an interpreter runs your Python code directly. This makes it fast to test your code and see results. However, it can be a bit slower than languages that are "compiled," like C.
Python is a great language for beginners. It's a "high-level" language, which means you can focus on what you want the computer to do, not how it does it. Writing programs in Python often takes less time than in other languages. Python was inspired by other programming languages such as C, C++, Java, Perl, and Lisp.
Contents
How Python Code Looks
Python code is very easy to read. Some of its style comes from the C language, which Python itself was written in. A big difference in Python is how it uses spaces or tabs to organize code. This is called "whitespace."
Because of this, you don't need a semicolon (;) at the end of each line. You also don't use curly braces ({}) to group code, which are common in languages like C. All these features make Python a very clear and readable language.
What Python Is Used For
Hundreds of thousands of programmers use Python every day. It's used in many different places. Sometimes, a whole program is written only in Python. Other times, Python handles simpler tasks while another language does the more complex work.
Python comes with a "standard library" of many useful tools. When you install Python, these tools are ready to use. There are also many other "libraries" available online. These extra libraries let Python do even more amazing things. They make it a very powerful and flexible language!
Some common uses for Python include:
- Making websites (web development)
- Creating games
- Building desktop programs with GUIs (graphical user interfaces)
- Doing scientific calculations and research
- Programming computer networks
Simple Python Examples
Here is a small example of a Python program. It simply shows the words "Hello World!" on your screen.
print("Hello World!")
# This code does the same thing, but it's a bit longer:
ready = True
if ready == True:
print("Hello World!")
Python also uses "dynamic variable assignment." This means you don't have to tell the program if a variable will hold a number or a word. This makes it easy to change what a variable holds. Look at the example below. This code uses the same variable, `x`, to first store a number and then a word. Both will be shown on the screen.
x = 1
print(x)
x = "Word"
print(x)
In other languages, like C, you would have to say if `x` was a number or a word right away. You couldn't change its type later from a number to a word.
Images for kids
See also
In Spanish: Python para niños