GK SOLUTIONS
AI • IoT • Arduino • Projects & Tutorials
DEFEAT THE FEAR

Python Language Introduction

⏱️ Estimated time: 15 minutes | Difficulty: Beginner

Table of Contents

What is Python Programming?

Python is a high-level, general-purpose, and very popular programming language. Python programming language (latest release is Python 3) is being used in web development, Machine Learning applications, along with all cutting-edge technology in Software Industry. Python language is being used by almost all tech-giant companies like Google, Amazon, Facebook, Instagram, Dropbox, Uber etc.

Note on Readability

The biggest strength of Python is a huge standard library that can be used for the following: Machine Learning, GUI Applications (like Kivy, Tkinter, PyQt), Web frameworks (like Django, Flask), Image processing, and Web scraping. Most importantly, Python code is extremely readable and resembles plain English!

Brief History of Python

  • Python was conceptually created by Guido Van Rossum in the late 1980s.
  • It was published for the first time in February 1991 at the National Research Institute for Mathematics and Computer Science in the Netherlands.
  • Python's name is derived from the British comedy group "Monty Python", as Guido was a huge fan of "Monty Python's Flying Circus".

Why Should We Learn Python?

Python provides an unmatched learning curve for beginners and immense power for experts.

  • Interpreted: Python code runs directly line-by-line, which makes debugging incredibly easy compared to compiled languages like C or C++.
  • Dynamically Typed: You don't need to declare whether a variable is an integer or string. Python figures it out at runtime!
  • Object-Oriented: Supports classes, objects, and all modern programming paradigms.
  • Extensive Community: Millions of developers write Python, meaning any issue you face has likely already been solved on StackOverflow.

First Python Program (Hello World)

Let's look at the absolute simplest program you can write in Python. The simplicity of Python is truly staggering when compared to C or Java.

# Simple Python program to display "Hello World"

# Print statement
print("Hello World")
Try It Yourself
Hello World
Time Complexity: O(1)
Space Complexity: O(1)

Fun Fact

In C, writing a Hello World program takes about 5 lines of code. In Java, it takes about 5 lines of code. In Python, it takes exactly 1 line of code. No semicolons, no curly braces, no main functions required!

Explanation of the Python Program

There isn't much to break down, because python reads like English, but let's go over the specifics.

1

# (Comments)

Lines starting with a hash `#` are comments. They are completely ignored by the Python interpreter and are meant solely for human readers to understand what the code does.

2

print()

print() is a built-in Python function that outputs the given text (or variables) to the console.

3

"Hello World"

The text inside the quotation marks is a String—a basic data type used to represent text in programming.

Applications of Python

  • Data Science & AI: The undisputed king of AI with libraries like TensorFlow, PyTorch, Pandas, and NumPy.
  • Web Development: Backend frameworks like Django and Flask are used by companies like Instagram and Pinterest.
  • Automation & Scripting: Easily automate boring tasks on your computer (e.g., renaming thousands of files automatically).
  • Cybersecurity: Penetration testing and writing hacking scripts are extremely common in Python.
← Overview Next Lesson: Variables and Data Types →