How to clean the buff of Python obey

Hello person, I have a problem next, I have a project menu that returns the value of the options for main, but the last choice is the project bug. How can I clean this item?
Here is a piece of code:

& # 39; & # 39; & # 39;
Python
& # 39; & # 39; & # 39;

# The menu item where you return options.
option = str (input ())

if option.isnumeric () and 0 <int (option) <6:
system (& # 39; cls & # 39;)
return option

if not:
while true:

print ('invalid' option.  ntry again: 'end =')
option = str (input ())
system (& # 39; cls & # 39;)

if option.isnumeric () and 0 <int (option) <6:
return option

if option.isnumeric () and 0 <int (option) <6:
pause

# Main piece:

while true:

answer = menu () # I want to clear the object "RESPONSE".
if answer == 1 & # 39 ;:
print (This function is being incremented.)
if answer == 2 & # 39 ;:
resp_cadastro2 = search ()
if resp_cadastro2:
research ()
if not:
menu ()