Answer
See explanation
Work Step by Step
Below there is the main function as described in the question.
def main():
$\quad$ print("Please enter at max 10 characters, one character per line. Enter % to end the message")
$\quad$ data=[]
$\quad$ while(True):
$\quad$ $\quad$ char=input()
$\quad$ $\quad$ if char == "%":
$\quad$ $\quad$ $\quad$ break
$\quad$ $\quad$ else:
$\quad$ $\quad$ $\quad$ data.append(char)
$\quad$ n=len(data)
$\quad$ print("The message is: ",end="")
$\quad$ for i in range(n):
$\quad$ $\quad$ print(data[i],end="")
main()