Hello everyone,
In the excercise below I’m trying to create a for loop that sorts through a string and counts the number of medical records by adding the count of ‘#’ to a list:
updated_medical_data = print(medical_data.replace('#','$'))
num_records = 0
for i in updated_medical_data:
if i == '$':
num_records += 1
However, when I execute this code it gives the error message: ‘for i in updated_medical_data:
TypeError: ‘NoneType’ object is not iterable’.
Does anyone know how to solve this? It would be much appreciated!