My code is sorting the sentences of file based on a length of the sentences by their length and saving to a new file.

How can I alter my code so that if the user inputs any number at program start, we filter the lines based on that input.

Example: The user inputs `50` - the program will sort all sentences that have a greater length than 50 or if the user inputs `all` then the program will sort all lines as normal.

**My code:**

```
file = open("testing_for_tools.txt", "r")
lines_ = file.readlines()
#print(lines_)
user_input = input("enter")
if user_input is int:
    lines = sorted(lines_, key=len)
else:
    lines = sorted(lines_, key=len)
# lines.sort()
file_out = open('testing_for_tools_sorted.txt', 'w')
file_out.write(''.join(lines))  # Write a sequence of strings to a file
file_out.close()
file.close()
print(lines)

```