1)
fruits = ("Apple", "Banana", "Mango", "Orange", "Papaya", "Grapes", "Mango", "Kiwi", "Custard
Apple", "Pineapple")
index = fruits.index("Custard Apple")
count = fruits.count("Mango")
print("Index of Custard Apple:", index)
print("Count of Mango:", count)
OUTPUT:-
2)
countries = ["India", "USA", "Brazil", "China", "Japan", "Germany", "France", "Italy"]
countries.append("Australia")
countries.remove("Brazil")
countries.reverse()
print(countries)
OUTPUT:-
3)
numbers = (1, 3, 5, 5, 2)
index = numbers.index(3)
count = numbers.count(5)
print("Index of 3:", index)
print("Count of 5:", count)
OUTPUT:-
4)
students = {
"John": {"age": 20, "courses": ["Math", "Science"], "CGPA": 3.8},
"Alice": {"age": 22, "courses": ["English", "History"], "CGPA": 3.9},
"Bob": {"age": 21, "courses": ["Physics", "Chemistry"], "CGPA": 3.6}
students["Wednesday"] = {"age": 23, "courses": ["Biology", "Psychology"], "CGPA": 4.0}
for s in students:
students[s]["CGPA"] += 0.1
for name, info in students.items():
print(name, info["courses"], "Updated CGPA:", info["CGPA"])
OUTPUT:-
5)
movies = ["Dangal", "PK", "3 Idiots", "Lagaan", "Swades", "Taare Zameen Par", "Chak De India",
"Zindagi Na Milegi Dobara"]
movies.append("Andhadhun")
movies.insert(2, "Dil Chahta Hai")
movies.pop()
movies.pop(1)
movies.reverse()
copied_movies = movies.copy()
print(copied_movies)
OUTPUT:-
6)
students = {
"Ravi": ["Math", "Science"],
"Neha": ["English", "History"],
"Amit": ["Geography", "Economics"]
students["Neha"] = tuple(students["Neha"])
print(students)
OUTPUT:-