FDS2
FDS2
def LongestWord():
str = []
str.append(element)
max_len = len(str[0])
temp = str[0]
max_len = len(word)
temp = word
def Frequency():
dict = {}
for i in str:
keys = dict.keys()
if i in keys:
dict[i] += 1
else:
dict[i] = 1
print(dict)
def Palindrome():
if(str == str[::-1]):
else:
def Find_Substr():
return i
def OccurWords():
counts = dict()
words = str.split()
if word in counts:
counts[word]+= 1
else:
counts[word] = 1
print(counts)
#Driver code
while(True):
print("\n 6. Exit")
choice = int(input())
if(choice == 1):
LongestWord()
elif(choice == 2):
Frequency()
elif(choice == 3):
Palindrome()
elif(choice == 4):
print(Find_Substr())
elif(choice == 5):
OccurWords()
else:
print("Exitting")
break