Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How can i divide a word that the user inputs in syllables? in python plz

+4 votes
asked Feb 24, 2025 by ste (160 points)

1 Answer

+1 vote
answered Mar 3, 2025 by Peter Minarik (101,420 points)

This logic may change from language to language (e.g. English may have different rules than German).

Most frontend frameworks support such features and you can turn them on. E.g. in C#, you have the TextBlock.IsHyphenationEnabled for this.

If you have to write this, that sounds like a homework to me. For such things, you should make your best effort to implement this and share your code for review or if you get stuck.

The idea is that you find where a new syllable starts (typically a consonant followed by a vowel) and you put the hyphen before the new syllable.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...