2 Minutes Crash Course on Python for Begineers
2 Minutes Crash Course on Python for Begineers
If you are learning AI or Generative AI, it’s good to have a basic understanding of Python. You don’t
need to be python expert, but without knowing ABCs of Python, you may struggle to understand few
AI concepts.
Having this in mind, I have prepared a quick 2-minute crash course on Python, specially for AI
professionals.
Target Readers
Anyone who wants to have a quick understanding of Python and learn basic Python programming.
Specially, if you are working on AI and Generative AI, this crash course can be super helpful.
Note: If you are new to AI and Generative AI, I strongly recommend you to go through the blog
series Generative AI for Beginners. It will only take 90 minutes of your time. No perquisites. You will
get a crystal-clear idea on AI and generative AI.
What is Python?
Python is a popular programming language known for its readability and versatility. It's used for web
development, data analysis, machine learning, automation, and much more.
TensorFlow
PyTorch
Developed by Facebook, it's popular for research and production in deep learning.
scikit-learn
Open-source machine learning library, which provides simple and efficient tools for data mining and
data analysis.
Keras
Open-source, neural networks API written in Python. It is designed to be user-friendly, modular, and
extensible, making it easy for developers to create deep learning models.
NumPy
Library for numerical computing, designed to handle large, multi-dimensional, as well as a collection
of mathematical functions.
Strong Community Support
Python has a large and active community of developers. This means that there is a wealth of
tutorials, forums, and resources available to help you learn and troubleshoot issues.
Install Python
Go to python.org and download the latest version of Python.
print("Hello, World!")
PIP
PIP is a package manager for Python packages. If you have Python version 3.4 or later, PIP is
included by default.
PIP is used to install and manage software packages. These packages are collections of code
written by others that you can use in your own projects to save time and add functionality.
For example, if you need a library to help with data analysis or web development, you can
easily install it using pip.
Python developers can upload and share their packages using this repository. When you use
pip to install a package, it often fetches it from PyPI.
Jupiter Notebook
Jupyter Notebook is a tool in Python that allows you to write and run code, visualize results,
and add explanations all in one place. It lets you write and run code in small chunks, making
it easier to test and debug your code step-by-step.
We can use pip command to install Jupyter notebook.
Basic Syntax
Printing to the Screen
The print function is used to display output.
print("Hello, World!")
Variables
Variables store data. You don't need to declare the type explicitly.
name = "Alice"
age = 25
print(name, age)
Data Types
Common data types in Python include:
• Strings: Text data.
• Integers: Whole numbers.
• Floats: Decimal numbers.
• Booleans: True or False values.
text = "Hello"
number = 10
pi = 3.14
is_happy = True
Lists
Lists store multiple items in a single variable.
fruits = ["apple", "banana", "cherry"]
print(fruits)
Dictionaries
Dictionaries store data in key-value pairs.
Conditionals
Use if, elif, and if to make decisions.
Functions
Functions are reusable blocks of code.
def greet(name):
return f"Hello, {name}!"
print(greet("Alice"))
Summary
Hopefully, this quick crash course will help you get basic understanding of Python. You are now
equipped to do basic operations and programming in Python. As and when required, dive deep into
individual topics.
Happy Learning!