PYTHON PRACTICAL FILE
ARTIFICIAL INTELLIGENCE
MAHEK DHANUKA
X A 13
CODE 1 :
# Lists representing heritage and headway
heritage = ['Taj Mahal', 'Agra Fort', 'Ajanta and Ellora Caves', 'Khajuraho
Group of Monuments', 'Hampi']
headway = ['Metro Railway', 'Unified Payment Interface-UPI', 'Chandrayaan-1
and Chandrayaan-3', 'the Mars Orbiter Mission (Mangalyaan)']
# Merge the two lists
heritage_and_headway = heritage + headway
# Display the unified list
print("Celebrating the blend of Heritage and
Headway:",heritage_and_headway)
OUTPUT
Celebrating the blend of Heritage and Headway: ['Taj Mahal', 'Agra Fort',
'Ajanta and Ellora Caves', 'Khajuraho Group of Monuments', 'Hampi', 'Metro
Railway', 'Unified Payment Interface-UPI', 'Chandrayaan-1 and Chandrayaan-
3', 'the Mars Orbiter Mission (Mangalyaan)'
CODE 2:
# Strengths of the two villages
L1 = [111, 513, 15]
L2 = [222, 434, 346]
new_generation = []
for i in range(len(L1)):
new_generation.append(L1[i] + L2[i])
print(new_generation)
OUTPUT:
[333, 947, 505]
CODE 3:
import [Link] as plt
x = [6, 20]
y = [12, 30] [Link](x, y, marker='o', linestyle='-',
color='blue')
[Link]('X-axis')
[Link]('Y-axis')
[Link]('Line Chart from (6,12) to (20,30)')
[Link](True)
[Link]()
OUTPUT
CODE 4:
import [Link] as plt
pollution = [1, 2, 3, 4]
temperature_impact = [x**3 for x in pollution]
[Link](pollution, temperature_impact, marker='o',
linestyle='-', color='red')
[Link]('Pollution Level')
[Link]('Temperature Impact')
[Link]('Cubic Relationship: Pollution vs Temperature
Impact')
[Link](True)
[Link]()
OUTPUT
CODE 5:
import numpy as np
import statistics as st
L1 = [200, 505, 450, 520, 505]
mean = [Link](L1)
median = [Link](L1)
mode = [Link](L1)
print("Mean:", mean)
print("Median:", median)
print("Mode:", mode)
OUTPUT
Mean: 436.0
Median: 505.0
Mode: 505
CODE 6
import [Link] as plt
ice_cream = ['cream_bell', 'baskin_robbins',
'kwality']
data = [20, 10, 30]
[Link](data, labels=ice_cream)
[Link]('Ice Cream Eating Competition Results')
[Link]('equal')
[Link]()
OUTPUT
CODE 7:
import [Link] as plt
waste_types = ['Plastic', 'Organic', 'Electronic']
waste_values = [25, 40, 15]
[Link](waste_values, labels=waste_types)
[Link]('Sources of Waste in the Community')
[Link]('equal')
[Link]()
OUTPUT
CODE 8
import [Link] as plt
# Dataset A
handcrafted_arts = [75, 65, 85]
folk_music = [60, 75, 90]
# Dataset B
digital_design = [90, 120, 100]
ai_music_generator = [80, 100, 120]
[Link](handcrafted_arts, folk_music, color='green',
label='Traditional (Dataset A)')
[Link](digital_design, ai_music_generator, color='blue',
label='Digital (Dataset B)')
[Link]('Art/Design Scores')
[Link]('Music Scores')
[Link]('Scatter Chart: Traditional vs Digital Creativity')
[Link](True)
[Link]()
OUTPUT
CODE 9:
import [Link] as plt
x = [13, 25, 20]
y = [50, 70, 60]
[Link](x, y, color='purple')
[Link]('Community Education Initiatives')
[Link]('Environmental Awareness Level')
[Link]('Impact of Education Initiatives on
Environmental Awareness')
[Link](True)
[Link]()
OUTPUT
CODE 10:
import numpy as np
team_strikers = [Link]([180, 145, 200])
team_blazers = [Link]([170, 160, 190])
combined score= [team_strikers+ team_blazers]
print(combined_score)
OUTPUT
[array([350, 305, 390])]
CODE 11:
Roots=['oral storytelling','handwritten
manuscripts','mechanical clock']
Wings=['digital publishing','Al−generated
content','smartwatches']
timeline = Roots + Wings
print(timeline)
OUTPUT
['oral storytelling', 'handwritten manuscripts',
'mechanical clock', 'digital publishing', 'Al−generated
content', 'smartwatches']
CODE 12:
import [Link] as plt
foods = ['Biryani', 'Pani Puri', 'Papri Chaat']
preferences = [50, 30, 20]
[Link](preferences, labels=foods)
[Link]('Most Popular Indian Food Preferences
Among Students')
[Link]('equal')
[Link]()
OUTPUT