i want to extract a certain keyword called "Visual Impairment" from a huge text file. i know this is probably a very minor issue but i am still fairly new to Python so please help :)
an example of the text file: {'Sensory and Communication': {'Visual Impairment': 'No', 'Hearing Impairment': 'YesMild', 'Communication': 'YesVerbal'}
i want it to be such that 'No = 0' and the output to be
Visual Impairment: 0
my code now is
file_path ='C:\\Users\L31308\Desktop\\IFA.txt'
with open(file_path,'r') as f:
data = f.read()
def sensoryAndCommunication(visualImpairment, hearingImpairment, communication):
if visualImpairment == 'Visual Impairment':
if visualImpairment == 'No':
visualImpairment = 0
print("Visual Impairment" + visualImpairment)