Question: count _ by _ first ( ) This function should accept a parameter named words, which is expected to contain a list of strings representing
countbyfirst
This function should accept a parameter named words, which is expected to contain a list of strings representing words.
The function should determine the number of strings in words with each possible starting letter and display the results.
The steps performed by this function are very similar to those described in the countbylength function. The
main difference is that you will be using the first characters of strings in words as keys in countdict rather than the
length of the string. Note that if mystring is a string, then you can access the first character of mystring using
mystring
Print the results in the format shown below. The symbols should be replaced with letters and the ### symbols should
be replaced with word counts. The dashed line should be characters long. Allot characters for the word column
and characters for the count column. The word column should be leftaligned and the count column should be right
aligned. The desired alignments can be obtained using fstrings.
The rows in your output should be arranged so that the letter column is in increasing order from a to
This function should not return any value.
Instructions for the Notebook
Any set of instructions you see in this document with an orange bar to the left will indicate a place where you should create
a markdown cell. If no instructions are provided regarding formatting, then the text should be unformatted.
Any set of instructions you see with a blue bar to the left will provide instructions for creating a single code cell.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
