generate functionSat, 01 Apr 2023

Exclude column values which are greater than 033A and small than 033Z from text file

def exclude_values(filename): f = open(filename, "r") content = f.close() content = content.split() exclude_values = [] for value in content: if 033A <= value <= 033Z: exclude_values.append(value) return exclude_values exclude_values("file.txt")

Questions about programming?Chat with your personal AI assistant