Answer:
#HERE IS CODE IN PYTHON
#function to find length of shortest and longest string in the array
def fun(list2):
#find length of shortest string
mn=len(min(list2))
#find length of longest string
mx=len(max(list2))
#return both the value
return mn,mx
#array of strings
list2 = ['Ford', 'Volvo', 'BMW', 'MARUTI','TATA']
# call the function
mn,mx=fun(list2)
#print the result
print("shortest length is:",mn)
print("longest length is:",mx)
Explanation:
Create an array of strings.Call the function fun() with array as parameter. Here min() function will find the minimum string among all the strings of array and then len() function will find its length and assign to "mn". Similarly max() will find the largest string and then len() will find its length and assign to "mx". Function fun() will return "mn" & "mx".Then print the length of shortest and longest string.
Output:
shortest length is: 3
longest length is: 5
Answer:
from collections import Counter
def anagram(dictionary, query):
newList =[]
for element in dictionary:
for item in query:
word = 0
count = 0
for i in [x for x in item]:
if i in element:
count += 1
if count == len(item):
newList.append(item)
ans = list()
for point in Counter(newList).items():
ans.append(point)
print(ans)
mylist = ['jack', 'run', 'contain', 'reserve','hack','mack', 'cantoneese', 'nurse']
setter = ['ack', 'nur', 'can', 'con', 'reeve', 'serve']
anagram(mylist, setter)
Explanation:
The Counter class is used to create a dictionary that counts the number of anagrams in the created list 'newList' and then the counter is looped through to append the items (tuple of key and value pairs) to the 'ans' list which is printed as output.
Answer:
Independence
Explanation:
Management information system (MIS) is the system that acts as the backbone of an organization's activities, holding everything together. According to my research on MIS, I can say that based on the information provided within the question the one term that is not considered an advantage would be Independence. Since MIS doesn't really provide independence since the organization depends on the system.
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.
It is a good programming practice to explain your functions by writing comments that describe what they do.
Answer:
Interpolation string.
Explanation:
The proces of adding the variable in middle the string.The interpolation Replace the value of the Variable when the string data is processed .In the Interpolation process the variable is permitted with string containing double quotes.In the interpolation string the interpreter check the entirely string that the variable in middle the string.
Following is the example of interpolation string in Php
$n1 = "RAM";
echo "hello $name"; // output
Output:
hello RAM