[Resolved] Python Overflow | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

11th Feb 2018, 9:16 PM
luciel
luciel - avatar
2 Answers
+ 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 += " "
11th Feb 2018, 9:42 PM
Toni Isotalo
Toni Isotalo - avatar
+ 2
Thank you! It works. I appreciate it.
11th Feb 2018, 9:47 PM
luciel
luciel - avatar