Question: CSC2230 Computer Programming for Engineers. This is python jupyter notebook. Write a function that takes a list of strings and returns a dictionary that has

CSC2230 Computer Programming for Engineers. This is python jupyter notebook.

CSC2230 Computer Programming for Engineers. This is python jupyter notebook. Write a

Write a function that takes a list of strings and returns a dictionary that has each string as a key, and the number of characters in the string as the value. For example, given the following list, t' apple' , . orange . cat' ] the function returns the following dictionary: 'apple': 5, orange': 6 car 3) In :def strToLenDict (s): d- dict() iterate elements in the list s while creating records in dictionary d. return d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!