0% found this document useful (0 votes)
5 views3 pages

Python Lecture 1 Notes

Python is a popular and beginner-friendly programming language used for various applications like web apps and data science. The document covers the basics of programming, including downloading Python, writing simple programs, using variables, data types, and performing operations. It emphasizes the importance of practice in learning programming skills.

Uploaded by

sumaira iftikhar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Python Lecture 1 Notes

Python is a popular and beginner-friendly programming language used for various applications like web apps and data science. The document covers the basics of programming, including downloading Python, writing simple programs, using variables, data types, and performing operations. It emphasizes the importance of practice in learning programming skills.

Uploaded by

sumaira iftikhar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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)

You might also like