nastasiasnk commited on
Commit
6866b1f
1 Parent(s): 097b913

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -11,6 +11,12 @@ def test(input_json):
11
  inputs = json.loads(input_json)
12
  except json.JSONDecodeError:
13
  inputs = json.loads(input_json.replace("'", '"'))
 
 
 
 
 
 
14
  #print("Parsed input keys:", inputs.keys())
15
 
16
  #print("Parsed input values:", inputs.values())
@@ -23,7 +29,7 @@ def test(input_json):
23
 
24
  # Prepare the output
25
  output = {
26
- "test result": input_json
27
  }
28
 
29
  return json.dumps(output)
 
11
  inputs = json.loads(input_json)
12
  except json.JSONDecodeError:
13
  inputs = json.loads(input_json.replace("'", '"'))
14
+
15
+ # Accessing the 'a_list' string and converting it to a list of integers
16
+ a_list_string = data['input']['a_list']
17
+ a_list = [int(item.strip()) for item in a_list_string.split(',')]
18
+
19
+
20
  #print("Parsed input keys:", inputs.keys())
21
 
22
  #print("Parsed input values:", inputs.values())
 
29
 
30
  # Prepare the output
31
  output = {
32
+ "test result": a_list
33
  }
34
 
35
  return json.dumps(output)