can someone tell me how i would fix this
from pathlib import Path
def is_txt_file(path_to_file):
t_or_f = 4
file_path = Path(path_to_file)
if file_path.suffix == ".txt":
t_or_f = 1
elif file_path.suffix is None:
print(file_path.suffix)
t_or_f = 2
elif file_path.suffix is not None:
print(file_path.suffix)
t_or_f = 3
else:
print("error in code 1")
return t_or_f
main_input = input("")
t_or_f = is_txt_file(Path(main_input))
if t_or_f == 1:
print("file is txt")
elif t_or_f == 2:
print("file is value less")
elif t_or_f == 3:
print("error in code 2")
elif t_or_f == 4:
print("error in code 3")