Python Lecture 1 Notes (Easy Version)
1. What is Python?
Python is a very popular programming language.
It is easy to read and write even for beginners.
You can use it for many things like web apps, data science, AI, and more.
2. How Programming Works
Programming means telling the computer what to do step by step.
Python is a high-level language which means it looks more like English than machine
code.
You write instructions that the computer follows.
3. Downloading & Setup
To run Python on your computer:
o Go to [Link] and download Python.
o Install it.
o Use an editor (like VS Code) to write .py files.
You write your code, save it, and run it in the Python interpreter.
4. First Python Program
Example:
print("Hello World")
This line tells Python to print text on the screen.
This is usually the first program beginners write.
5. Variables
A variable stores a value.
Example:
name = "Ali"
age = 20
name and age are names you choose to store data.
Python figures out the type automatically.
6. Data Types
Python has basic types like:
Integer (whole numbers)
Float (decimal numbers)
String (text)
Boolean (True or False)
7. Simple Operations
You can do math in Python:
a = 10
b = 5
print(a + b)
This will print 15.
8. Input from User
You can ask the user to type something:
num = input("Enter a number: ")
By default, input is text. To use it as a number, convert:
num = int(input("Enter a number: "))
That changes the text into a number.
9. Why Practice Matters
Just watching is not enough. To learn programming you must write code yourself and try
examples.
Basics To Practice from this Lecture
Try these in your Python editor:
1. Print your name
print("Your Name")
2. Add two numbers
a = 5
b = 7
print(a + b)
3. Input and print
name = input("What is your name? ")
print("Hello", name)