- 1

the expected output which should be: {3 : ['the','sun', ' the' ], 4:'ship', 6 : 'shines', 5: 'signs'} any help pls?

Strings to dict https://code.sololearn.com/csYnWEAnLR0W/?ref=app

28th Jun 2021, 4:09 PM
Femi SONI Y
Femi SONI Y - avatar
6 Antworten
+ 2
https://code.sololearn.com/cL8M0GM5tCs8/?ref=app is that code what you're expecting?
28th Jun 2021, 9:07 PM
visph
visph - avatar
+ 1
Slick the output was different from the expected output as given in the question
28th Jun 2021, 9:56 PM
Femi SONI Y
Femi SONI Y - avatar
+ 1
Ipang the key is the length of each word in the str. after spliting to a list And there are three stings whose length is 3. The output of dictionary is not ordered. Am sorry if i do not fully comprehend what you meant.
28th Jun 2021, 10:11 PM
Femi SONI Y
Femi SONI Y - avatar
0
Why key order should be 3, 4, 6, 5? There is a substring having 2 characters long, why it isn't expected in output?
28th Jun 2021, 4:35 PM
Ipang
0
your code seems correct! im sorry, what's wrong?
28th Jun 2021, 4:36 PM
Slick
Slick - avatar
0
visph thanks alot, oh mine!
28th Jun 2021, 9:53 PM
Femi SONI Y
Femi SONI Y - avatar