###write a python function that return the index of smallest element...
lst=eval(input("enter list :"))
length=len(lst)
min_el=lst[0]
mindex=0
for i in range(1,length):
if lst[i]<min_el:
min_el=lst[i]
mindex=i
print("given list:",lst)
print("miinimum element:",min_el)
print("index:",mindex)
enter list :9,8,75,65,84,3,9,1,74,82 given list: (9, 8, 75, 65, 84, 3, 9, 1, 74, 82) miinimum element: 1 index: 7
print("Enter 10 names of your choice")
names=[]
for i in range(10):
name=str(input())
names.append(name)
def mostcommonname(lst):
common=[]
count=1
for i in lst:
word_count=lst.count(i)
if word_count>count:
count=word_count
common.append(i)
return common
print("The most common names in the list are: ", mostcommonname(names))
print("Enter 10 names of your choice")
names=[]
for i in range(10):
name=str(input())
names.append(name)
def mostcommonname(lst):
common=[(lst.count(i),i) for i in lst]
max_ele=max(common)[0]
comm_elem=[]
for x in common:
if x[0]==max_ele:
comm_elem.append(x[1])
return comm_elem
if comm_elem==[]:
print("None")
print("The common names in the given list are ", set(mostcommonname(names)))
print("Enter 10 elements of your choice")
ele=[]
for i in range(10):
x=input()
ele.append(x)
print(ele)
def isPalindromicList(a):
if ele==ele[::-1]:
palindrom=True
else:
palindrom=False
return palindrom
isPalindromicList(ele)