๐Ÿ“˜ Python Programming Labs in Roman Urdu (24CE)

๐Ÿ“˜ Python Programming Labs in Roman Urdu


1. Introduction to Python Programming

Lab Objective: Python ka basic structure samajhna aur โ€œHello Worldโ€ program likhna.

Roman Urdu:
Python aik high-level programming language hai jo asaan aur readable hai. Is lab mein aap aik chhota sa program banayenge jo sirf โ€œHello, World!โ€ print karega.

pythonCopyEditprint("Hello, World!")

2. Basic Input/Output and String Operations

Lab Objective: User se input lena aur output dena. Strings ke sath kaam karna.

Roman Urdu:
input() function se user ka input lete hain aur print() se usay dikhate hain.

pythonCopyEditname = input("Apka naam kya hai? ")
print("Assalam o Alaikum, " + name)

3. Boolean Logic and Logical Operators

Lab Objective: and, or, not operators ka istemal.

Roman Urdu:
Boolean values yaani True aur False ka istemal conditions check karne ke liye hota hai.

pythonCopyEdita = 10
b = 5
print(a > 5 and b < 10)  # True

4. Working with Dates and Time

Lab Objective: Python ke datetime module ka use karna.

Roman Urdu:

pythonCopyEditimport datetime
current_time = datetime.datetime.now()
print("Aaj ki tareekh aur waqt:", current_time)

5. Conditional Statements (If/Else)

Lab Objective: if, elif, else ka istemal karna.

Roman Urdu:

pythonCopyEditage = int(input("Apki age kya hai? "))
if age >= 18:
    print("Aap vote de sakte hain.")
else:
    print("Aap vote nahi de sakte.")

6. Loops (For & While)

Lab Objective: for aur while loops ka istemal karna.

Roman Urdu:

pythonCopyEdit# For loop
for i in range(5):
    print("Number:", i)

# While loop
x = 0
while x < 5:
    print("x =", x)
    x += 1

7. Functions and Modular Programming

Lab Objective: Function banana aur call karna.

Roman Urdu:

pythonCopyEditdef greet(name):
    print("Hello", name)

greet("Ali")

8. Lists, Indexing, and Slicing

Lab Objective: Lists ka use karna aur unko slice/index karna.

Roman Urdu:

pythonCopyEditfruits = ["apple", "banana", "mango"]
print(fruits[0])         # "apple"
print(fruits[1:])        # ["banana", "mango"]

9. Numerical Operations and Math Libraries

Lab Objective: Math operations aur math library ka use.

Roman Urdu:

pythonCopyEditimport math
print(math.sqrt(16))  # 4.0

10. File Handling

Lab Objective: Files read/write karna.

Roman Urdu:

pythonCopyEdit# Write
with open("sample.txt", "w") as file:
    file.write("Hello, file!")

# Read
with open("sample.txt", "r") as file:
    print(file.read())

11. Object-Oriented Programming (OOP)

Lab Objective: Class aur object bananay seekhna.

Roman Urdu:

pythonCopyEditclass Student:
    def __init__(self, name):
        self.name = name

    def show(self):
        print("Student Name:", self.name)

s1 = Student("Ali")
s1.show()

12. Dictionaries and Tuples

Lab Objective: Dictionaries aur tuples ka use karna.

Roman Urdu:

pythonCopyEditstudent = {"name": "Ali", "age": 20}
print(student["name"])

tup = (1, 2, 3)
print(tup[0])

13. Data Visualization using Matplotlib

Lab Objective: Simple chart banana using matplotlib.

Roman Urdu:

pythonCopyEditimport matplotlib.pyplot as plt

x = [1, 2, 3, 4]
y = [10, 20, 25, 30]

plt.plot(x, y)
plt.title("Simple Graph")
plt.show()

14. Computational Problem Solving

Lab Objective: Real-world problems ka solution dena coding se.

Roman Urdu:
Aap simple masail solve karenge jaise calculator banana, ya kisi number ka factorial nikalna.


15. Error Handling and Debugging

Lab Objective: try, except blocks ka use karna errors handle karne ke liye.

Roman Urdu:

pythonCopyEdittry:
    num = int(input("Kisi number ka square nikaalain: "))
    print(num ** 2)
except:
    print("Error: Sahi number daalein.")

Leave a Comment

Your email address will not be published. Required fields are marked *

wpChatIcon
    wpChatIcon
    Scroll to Top