Professional Documents
Culture Documents
Total Marks: 05
Obtained Marks:
ARTIFICIAL
INTELLIGENCE LAB
LAB TASK # 01
Question 1
Code:
#APPEND
fruits = ["apple", "mango", "cherry"]
fruits.append("banana")
print(fruits)
#EXTEND
fruits = ["apple", "mango", "cherry"]
fruits.extend(["banana", "peach"])
print(fruits)
#INSERT
lis = [2, 1, 3, 5, 3, 8]
lis.insert(3, 4)
lis.remove(3)
Output:
Question 2
Code:
Part1:)
Triangle
part2:)
Square:
from turtle import *
drawing_area = Screen()
drawing_area.setup(width=750, height=500)
shape('square')
for i in range(4):
left(90)
forward(150)
done()
part 3):
HEXAGON
from turtle import *
drawing_area = Screen()
drawing_area.setup(width=750, height=500)
shape('square')
for i in range(6):
forward (90)
left (300)
done()
part 4):
OCTAGON
from turtle import *
drawing_area = Screen()
drawing_area.setup(width=750, height=500)
shape('square')
for i in range(8):
forward (100)
left (45)
done()
Output:
Question 3
Code:
num = int (input("Enter the number : "))
Output:
Question 4
Code:
List1 = [12, 15, 32, 42, 55, 75, 122, 132, 150, 180, 200]
if List1[i]<=150:
if List1[i]%5==0:
print(List1[i])
Output: