This is the code I used.
message = 'As a reminder, you have an appointment with Dr. Smith tomorrow at 3:30 pm. If you are unable to make this appointment, please call our customer service line at least 1 hour before your scheduled appointment time.' count = 0 num = 0 output = ('', '', '', '', '', '', '', '', '') for i in message: count += 1 if count < 161: outputStr = output[num] + i ouput[num] = outputStr else: num += 1 outputStr = output[num] + i output[num] = outputStr count = 0 messsageNum = 0 for x in output: if x != '': messageNum += 1 print(f'message number {messageNum} is {x} and has a length of {len(x) character}') print('')