I can help you with first problem.
You have to show some effort,some just post there school task here.
That means that you have to post some code of what you are struggling with.
>>> s = 'a fine day with beautiful sun'
>>> l = s.split()
>>> l
['a', 'fine', 'day', 'with', 'beautiful', 'sun']
>>> [i for i in l if len(i) >= 3 and len(i) <=7]
['fine', 'day', 'with', 'sun']
>>> #Or better
>>> [i for i in l if 3 <= len(i) <= 7]
['fine', 'day', 'with', 'sun']
Here i use list comprehension this is ofen used in python.
If you dont understand it,try to break it up with a ordinary loop.
snippsat
Practically a Posting Shark
808 posts since Aug 2008
Reputation Points: 353
Solved Threads: 294
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852