+ 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 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 += " "
+ 2
Thank you! It works. I appreciate it.