Spaces:
Running
Running
File size: 389 Bytes
fa94948 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import random
import ast
import streamlit as st
def string_to_list(s):
try:
return ast.literal_eval(s)
except (SyntaxError, ValueError) as e:
st.error(f"Error: The provided input is not correctly formatted. {e}")
st.stop()
def get_randomized_options(options):
correct_answer = options[0]
random.shuffle(options)
return options, correct_answer |