Python Forum

Full Version: Python, breaking words
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I just started learning python and i got an assignment, if I pass it I automatically pass the whole semester Smile

So what i have to do is make a program that would automatically break the line once it reaches the end.
Example:

This is an exam-
ple of what i mu-
st do.

Problem is I have no idea where to start nor can I find any related tutorials, so any tips or links to a tutorial would be more than helpful.
WoW that looks so much more advanced then where we are in class, I am screwed haha
It is simple string manipulation. Yes, the links I provided contain a lot of information, but not all of it is relative to your problem. You need to scan the items and decide which might help and then try it. 

One other thing, your "description" of the problem does not fit with the example output.  You need to define what constitutes the  need to break the line, for instance, is it a certain number of characters? 

It will involve a little reading and some trial and error coding, but if it were too easy, I'm sure your instructors would not have made the offer they did.

We are glad to help and provide advise, but we will not write the code for you. You need to show you are making an effort.
Well said sir!
And i do like a challenge.

About description, basically words have to be separated between
syllables on the end of the line and separated with (-).