Diving into Python in this Data and AI World(Not a Snake , a Programming Language).

Yash MevadaYash Mevada
3 min read

What is Python? And Why is Everyone Crazy About It?

Here’s what I got to know:

  • Python is super easy to learn.

  • It is based on OOPs, Object-Oriented Programming concepts.

  • Python can be used in many fields like:

    • Building websites with Django and Flask.

    • Working with databases like SQL and PostgreSQL.

    • Handling data with libraries like NumPy.

    • Machine Learning and AI research.

    • Testing and automation work.

Basically, Python is like that all-rounder in a cricket team who can bat, bowl, and field. It can literally do everything!

Some Cool Features of Python

Why Python is so famous:

  • It’s simple and easy to understand.

  • It’s an interpreted language, which means you don’t have to deal with any crazy compiling stuff.

  • It has a huge collection of libraries.

  • It easily connects with other technologies.

  • Handling errors is easy.

  • It works on almost every operating system like Windows, Mac, and Linux.

    The Special Powers of Python

    Python has some special points that make it even cooler:

    • Fast execution.

    • Code is clean and simple to write.

    • Supports dynamic typing.

    • Manages memory really well.

Let’s Write Some Code!

The best part was when we wrote some basic Python code too:

  • Learned how to use the print function to show messages.

The print() Function - Display Messages

The print() function is used to display output on the screen. It’s one of the first things you’ll learn, and it’s super useful!

# This will display the text "Hello, World!"
print("Hello, World!")

When you run the code, it prints:

Hello, World!
  • Learned how to use the input function to take user input.

The input() Function - Taking User Input

The input() function allows you to take input from the user. It's like having a conversation with your program.

# Asking for the user's name
user_Name = input("What's your name? ")

# Greeting the user
print("Hello, " + user_Name + "!")

Sample output:

What's your name? John
Hello, John!
  • Learned about the type function to check the data type.

The type() Function - Check Data Type

The type() function helps you check the data type of a value, whether it's an integer, string, list, etc.

#checking for the Data type of Data
print(type(123))      
print(type("Hello"))

Sample output:

<class 'int'>
<class 'str'>
  • Indentation in Python

    Python uses indentation (spaces or tabs) to define blocks of code. Indentation is super important, as Python relies on it to understand where different blocks of code begin and end.

      # Example of indentation
      if 5 > 3:
          print("5 is greater than 3")
          print("This is part of the if block")
    
      # This is outside the if block, no indentation needed
      print("This is outside the if block")
    

    Sample output:

      5 is greater than 3
      This is part of the if block
      This is outside the if block
    

    Wrapping it Up!

    So there you go — Python is pretty much the all-in-one tool you need. Whether you're building websites, playing around with data, or diving into AI, Python makes everything easier. It’s simple, powerful, and can do a little bit of everything. If you haven't tried Python yet, seriously, give it a shot — it's worth it!

1
Subscribe to my newsletter

Read articles from Yash Mevada directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yash Mevada
Yash Mevada