def indexOfSmallestElement(L):
smallestIndex=0
smallestElement= L[0]
for i in range(1,len(L)):
if L[i]<smallestElement:
smallestElement=L[i]
smallestIndex=i
return smallestIndex
L= list(map(int,input("Enter list of numbers :").split()))
smallestIndex= indexOfSmallestElement(L)
print("smallest Index is:",smallestIndex)
Enter list of numbers :1 2 6 9 11 15 17 smallest Index is: 0
def mostCommonName(name_list):
max_frequency =0
commonName= name_list[0]
for name in name_list:
frequency=name_list.count(name)
if frequency > max_frequency:
max_frequency = frequency
commonName= name
return name
print(mostCommonName(["jane", "Aaron", "Jane","Cindy","Aaron"]))
Aaron
def isPalindrome(str):
for i in range(0,int(len(str)/2)):
if str[i] !=str[len(str)-i-1]:
return False
return True
S = "malayalam"
ans= isPalindrome(S)
if (ans):
print(" True, It is a palindrome.")
else:
print(" False, It is not a palindrome.")
True, It is a palindrome.