0% found this document useful (0 votes)
3 views5 pages

Class 9 AI Python Practical Record Formatted-1

The document is a practical record for Class 9 Artificial Intelligence at Mahatma Gandhi Vidyalaya, detailing ten Python experiments. Each experiment includes an aim, source code, and output, covering topics like arithmetic operations, list manipulations, tuple operations, and dictionary operations. The record serves as a guide for students to learn and practice basic Python programming concepts.

Uploaded by

aadhavraj2011
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)
3 views5 pages

Class 9 AI Python Practical Record Formatted-1

The document is a practical record for Class 9 Artificial Intelligence at Mahatma Gandhi Vidyalaya, detailing ten Python experiments. Each experiment includes an aim, source code, and output, covering topics like arithmetic operations, list manipulations, tuple operations, and dictionary operations. The record serves as a guide for students to learn and practice basic Python programming concepts.

Uploaded by

aadhavraj2011
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

Mahatma Gandhi Vidyalaya Sr Sec School DBHPS

Class 9 – Artificial Intelligence

Python Practical Record

Index

[Link] Experiment Name


1 Print Hello World
2 Arithmetic Operations
3 Even or Odd Number
4 Largest of Three Numbers
5 List – Append & Remove
6 List – Sum of Elements
7 List – Sorting
8 Tuple Operations
9 Dictionary Operations
10 Tuple Packing and Unpacking

Experiment – 1

Aim: To print Hello World.

Source Code:
print("Hello World")

Output:
Hello World

Experiment – 2
Aim: To perform arithmetic operations.

Source Code:
a=10
b=5
print("Addition:",a+b)
print("Subtraction:",a-b)
print("Multiplication:",a*b)
print("Division:",a/b)

Output:
Addition: 15
Subtraction: 5
Multiplication: 50
Division: 2.0

Experiment – 3

Aim: To check whether a number is even or odd.

Source Code:
num=int(input("Enter number: "))
if num%2==0:
print("Even")
else:
print("Odd")

Output:
Enter number: 8
Even

Experiment – 4
Aim: To find the largest of three numbers.

Source Code:
a,b,c=5,8,3
print("Largest:", max(a,b,c))

Output:
largest: 8

Experiment – 5

Aim: To perform list append and remove operations.

Source Code:
numbers=[10,20,30,40]
[Link](50)
[Link](20)
print(numbers)

Output:
[10, 30, 40, 50]

Experiment – 6

Aim: To find sum of elements in a list.

Source Code:
nums=[5,10,15,20]
print("Sum =", sum(nums))

Output:
Sum = 50
Experiment – 7

Aim: To sort elements in a list.

Source Code:
marks=[75,45,90,60]
[Link]()
print(marks)

Output:
[45, 60, 75, 90]

Experiment – 8

Aim: To demonstrate tuple operations.

Source Code:
t=(10,20,30,40)
print(t)
print(t[0])
print(len(t))

Output:
(10, 20, 30, 40)
10
4

Experiment – 9

Aim: To demonstrate dictionary operations.

Source Code:
student={"Name":"Ravi","Age":14,"Class":9}
print(student["Name"])
print([Link]())

Output:
Ravi
dict_keys(['Name', 'Age', 'Class'])

Experiment – 10

Aim: To demonstrate tuple packing and unpacking.

Source Code:
student=("Ravi",14,9)
name,age,cls=student
print(name)
print(age)
print(cls)

Output:
Ravi
14
9

Teacher’s Signature: ____________________

Student Name: ____________________

You might also like