What is Python

Python, named after the classic British comedy troupe Monty, is a widely-used, interpreted, object-oriented, high-level programming language with dynamic semantics. It is used for general-purpose programming and It was created in 1991 by Guido van Rossum.

Now, as a beginner, due to the use of some technical terms in the aforementioned description of Python, I don’t expect you to fully understand what Python truly is based solely on that description. For this reason, I’m providing explanations for the following terms: Interpreted, high-level, Object-oriented, and dynamic semantics.

  • Interpreted: This means that Python is an interpreted programming language. An interpreted programming language is a language that is converted into machine code (code the computer understands) with the help of a computer program known as an interpreter. The job of an interpreter, is to convert each line of code one at a time.

  • High-Level: This means that Python is a programming language that is easy to read. High-level languages are designed to be closer to English, making it easier for programmers to write, understand, and maintain code.

  • Object-Oriented: This means that Python is an object-oriented programming language. Object-oriented programming (OOP) is a way of programming that focuses on organizing code and data into reusable structures called “objects”. You don’t need to worry too much about this concept right now. The important thing to know is that Python supports a popular approach to writing code for better organization.

  • Dynamic Semantics: This refers to the way Python behaves, whereby certain aspects of Python code are determined during runtime (the period during which the Python program is actively executing or running). A huge part of this dynamic semantics has to do with the type systems in programming.

    So in programming, languages can be classified into two primary type systems, which are ways of categorizing data types. These type systems are: Static Type system and Dynamic Type system. Based on these systems, programming languages can be categorized as follows:

    • Statically typed languages: In statically typed languages, the data type of a variable is known and checked at compile-time (the time during which a program is converted into machine code), before the program is run. In statically typed languages, programs are compiled before they are run. Which means, before program execution, all data types are known.

    • Dynamically typed languages: This is the category Python falls in, and the dynamic semantics behavior of Python can be seen as a result of Python being in this category. So when a programming language is dynamically typed, the data type of variables in that language are not known until runtime. This means that the computer wouldn’t know if it is working with a string, boolean, integer or float until it starts working with them.
      Note: Strings, booleans, integers and floats are data types in a programming language and once you understand the basics of Python, most of these concepts will become understandable.

Advantages of Python as a programming language

  • Readability and Simplicity: Python’s syntax is designed to be easily readable and expressive. This makes it a great language for both beginners and experienced developers. In terms of readability, Python is easier than most other languages.

  • Large Standard Library: Remember, Python is a general-purpose programming language. This means it’s designed to handle a wide range of tasks. Because of this, Python comes with a lot of built-in tools known as libraries, which can assist you in various tasks.

  • Wide Range of Applications: Python can be used for a variety of applications, including web development, scientific computing, data analysis, artificial intelligence, machine learning, automation, scripting, and more. Its versatility makes it a go-to language for many different domains.

  • Employability: Python’s widespread use in various industries, such as tech, finance, scientific research, and more, means that learning Python can enhance your employability and open up job opportunities.

  • Third-Party Libraries and Frameworks: Third-party libraries are code written by other programmers that you can download and use in your programming project(s). Python has a vibrant ecosystem of these libraries and frameworks that can greatly simplify complex tasks. For example, libraries like NumPy, pandas, TensorFlow, are used in data science while Django is widely used in web development.

  • Ease of Learning: Python’s straightforward syntax and extensive documentation make it an excellent language for beginners to start learning programming concepts. Also, the popularity of this language has increased the availability of tutorials you can learn from online, as well as communities you can easily get help from in your learning journey.

What you can do with Python

Python is a general-purpose programming language. It is can be used in an extensive array of domains and applications. Here are some things you can do with Python:

  • Web development
  • Data Analysis and Visualization
  • Machine Learning and Artificial Intelligence
  • Automation and Scripting
  • Cybersecurity and Ethical Hacking
  • Game Development
  • Web Scraping and Data Retrieval

What you shouldn’t do with Python

So far, I’ve observed Python working well in various areas of application, except for one - mobile app development. I wouldn’t recommend using Python for mobile development because it adds unnecessary difficulty. For mobile development, tools like Flutter, Xcode, and Android Studio provide a smoother experience compared to using Python.

What Python code looks like

number = int(input("Enter a positive integer: "))
sum = 0
current_number = 1

while current_number <= number:
    sum += current_number
    current_number += 1

print(f"The sum of numbers from 1 to {number} is {sum}")

What the aforementioned code does is to calculate the sum of numbers from 1 up to a given number (provided by the user). I’m not expecting you to understand anything from this code as a complete beginner.

I’m only providing this code to show you what Python code looks like, so you can have a bit of a mental image of what writing code in Python can be like. Once you’ve grasped the basics of Python, everything in the provided code becomes understandable.