Write a program to read animal names from the user and store it in list and do the following operations
Remove 2nd animal name from the list
Find the total number of animals in a list.
Answers
Answered by
0
Answer:
animals = []
n = int(input("How many animals are there? \n"))
print("Enter all",n,"animal names-")
for i in range(n):
x = input()
animals.append(x)
print("Original list of animals:" , animals)
animals.pop(1)
print("After removing the second animal from the list:",animals)
print("The number of animals you entered:",len(animals))
Explanation:
Similar questions
Math,
8 days ago
Math,
8 days ago
Environmental Sciences,
8 days ago
Science,
16 days ago
Social Sciences,
9 months ago
Math,
9 months ago