Answer:
def wordsOfFreqency(words, freq):
text1 = "Apple apPLE mangO aPple orange Orange apple guava Mango mango"
words = []
words1 = []
words1 = text1.split()
words = [x.upper() for x in words1]
freq=[words.count(w) for w in words]
print(dict(zip(freq,words)))
return words
def main():
wordsOfFreqency(words, freq)
if __name__=="__main__":
main() # call main function
Explanation:
This will print the list of strings as per its word frequency.
Output is :
{4: 'APPLE', 3: 'MANGO', 2: 'ORANGE', 1: 'GUAVA'}
Answer:
Explanation:
For the first questions the variable's name is <u>Today,</u> and is declared like a date variable, this will be returned a date value.
For the second question, where the browser will show today's date because with the variable Today, we get the date and with the document.write(Today) is shown the variable information.
With the third question, the result will be "Hello!", because the August is the 8 month, and July the 7, in this case the IF is False and for that will show "Hello!".
Answer:
Following are the code to method calling
backwardsAlphabet(startingLetter); //calling method backwardsAlphabet
Output:
please find the attachment.
Explanation:
Working of program:
- In the given java code, a class "RecursiveCalls" is declared, inside the class, a method that is "backwardsAlphabet" is defined, this method accepts a char parameter that is "currLetter".
- In this method a conditional statement is used, if the block it will check input parameter value is 'a', then it will print value, otherwise, it will go to else section in this block it will use the recursive function that prints it's before value.
- In the main method, first, we create the scanner class object then defined a char variable "startingLetter", in this we input from the user and pass its value into the method that is "backwardsAlphabet".