Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3.6 Question 12 20 points Write a function named wordLengths that takes one string parameter, text You may assume that the given text contains

Python 3.6

image text in transcribed

Question 12 20 points Write a function named wordLengths that takes one string parameter, text You may assume that the given text contains only letters and white space Input: Return a dictionary in which each key is the length of a word in text and the corresponding value is the number of words of that length For example, the following would be correct output text = 'Go to Heaven for the climate Hell for the company' print(wordLengths(text)) 12: 2, 3: 4, 4: 1, 6: 1, 7: 2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions