i use this simple code (made by chatgpt):
def extract_data(body):
lines = body.split('\n') # Split the body text into lines
first_name = last_name = None # Initialize first_name and last_name as None
for i in range(len(lines) - 1): # Iterate over each line, leave out the last line
if "שם פרטי" in lines[i]: # If line contains "שם פרטי"
first_name = lines[i + 1].strip() # Extract the next line as first_name
elif "שם משפחה" in lines[i]: # If line contains "שם משפחה"
last_name = lines[i + 1].strip() # Extract the next line as last_name
output = [{'first name': first_name, 'last name': last_name}]
return output
i receive
output_missing
Please define output or return early.
id
oxoJXdKRLy3c5EwtrvzcLZ9A2ENs0kRl
runtime_meta
memory_used_mb
45
duration_ms
3
logs
why?
what wrong?