[Resolved] Python Overflow | Sololearn: Learn to code for FREE!


[Resolved] Python Overflow

In my code, if a user inputs a string too long, it prints the response, but extends the page. How do I make it to where if a user inputs a certain amount of letters, the response will go to a new line? (Similar to the overflow property in CSS) (This happens only via PC, mobile version has no issue) Code: https://code.sololearn.com/celkT6e7YINJ

2/11/2018 9:16:19 PM


2 Answers

New Answer


count = 0 maxLength = 7 #Amount of letters in one row for character in message: if character in binary: encodedMessage += binary[character] + " " count = count + 1 if(count == maxLength): encodedMessage += "\n" else: encodedMessage += " "


Thank you! It works. I appreciate it.