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

+3

[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

luciel

2 Answers

New Answer

+3

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 += " "

+2

Thank you! It works. I appreciate it.