epochs-demos commited on
Commit
71be638
·
verified ·
1 Parent(s): 8c84c53

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -21,7 +21,7 @@ st.markdown('')
21
  def check_solution(code, func_params):
22
  try:
23
  exec(code)
24
- globals_dict = {{}}
25
  exec(code, globals_dict)
26
  function_to_test = globals_dict.get(func_params.get('function_name'))
27
 
@@ -66,8 +66,7 @@ def main():
66
  st.write('''Sum of two values''')
67
 
68
  # Display sample example for all test cases
69
- sample_examples = "
70
- ".join([f"sum({{params}}) -> {{expected_output}}" for params, expected_output in [((1, 2), 3), ((1, 0), 1), ((-1, -2), -3)]])
71
  st.code(sample_examples, language="python")
72
  show_solution_button = st.form_submit_button("Show Solution")
73
  if show_solution_button:
 
21
  def check_solution(code, func_params):
22
  try:
23
  exec(code)
24
+ globals_dict = {}
25
  exec(code, globals_dict)
26
  function_to_test = globals_dict.get(func_params.get('function_name'))
27
 
 
66
  st.write('''Sum of two values''')
67
 
68
  # Display sample example for all test cases
69
+ sample_examples = "Sample"
 
70
  st.code(sample_examples, language="python")
71
  show_solution_button = st.form_submit_button("Show Solution")
72
  if show_solution_button: