0% found this document useful (0 votes)
12 views1 page

O Level Python Practical File

The document contains a practical file for O Level Python programming with ten example programs. These programs cover basic concepts such as printing, input/output, conditional statements, loops, data structures (lists, tuples, dictionaries), functions, and a simple calculator. Each program is presented with its code snippet demonstrating fundamental Python syntax and functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

O Level Python Practical File

The document contains a practical file for O Level Python programming with ten example programs. These programs cover basic concepts such as printing, input/output, conditional statements, loops, data structures (lists, tuples, dictionaries), functions, and a simple calculator. Each program is presented with its code snippet demonstrating fundamental Python syntax and functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

O Level Python Practical File

Program 1: Print Hello World


print("Hello World")

Program 2: Input and Output


name = input("Enter name: ") print(name)

Program 3: If Else Example


age = 18 if age>=18: print("Eligible") else: print("Not Eligible")

Program 4: For Loop


for i in range(1,6): print(i)

Program 5: While Loop


i=1 while i<=5: print(i) i+=1

Program 6: List Example


lst=[1,2,3] print(lst)

Program 7: Tuple Example


tup=(1,2,3) print(tup)

Program 8: Dictionary Example


d={"name":"Ram","class":10} print(d)

Program 9: Function Example


def add(a,b): return a+b print(add(2,3))

Program 10: Simple Calculator


a=10 b=5 print(a+b,a-b,a*b,a/b)

You might also like