saraht14 commited on
Commit
dad619f
·
verified ·
1 Parent(s): fae7952

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -271,8 +271,8 @@ def import_and_run_function(script_path, function_name, filename):
271
  set_error_message(f"Error: Function '{function_name}' must return a list of exactly 8 elements.")
272
  return None
273
 
274
- # if not all(isinstance(x, int) and x in [0, 1] for x in result):
275
- # return f"Error: Function '{function_name}' must return a list of 8 integers, each 0 or 1.", None
276
 
277
  print(f"Function '{function_name}' executed successfully. Output: {result}")
278
  set_error_message(f"Function '{function_name}' executed successfully.")
 
271
  set_error_message(f"Error: Function '{function_name}' must return a list of exactly 8 elements.")
272
  return None
273
 
274
+ if not all(isinstance(x, int) and x in [0, 1] for x in result):
275
+ return f"Error: Function '{function_name}' must return a list of 8 integers, each 0 or 1.", None
276
 
277
  print(f"Function '{function_name}' executed successfully. Output: {result}")
278
  set_error_message(f"Function '{function_name}' executed successfully.")