<jupyter_start><jupyter_text>Import `random` module:<jupyter_code>import random<jupyter_output><empty_output><jupyter_text>Use `random.choice()`<jupyter_code>def do():
    my_list = list(range(1, 7))

    random_item = random.choice(my_list) # <---

    print(random_item)

do()<jupyter_output>4<jupyter_text>Take input from the user using `input()` function:<jupyter_code>user_input = input("Roll? [y]/n: ")

if user_input and user_input.lower() == "y": # If it isn't empty and equals 'y'
    pass<jupyter_output>Roll? [y]/n: y<jupyter_text>Putting all together:<jupyter_code>user_input = input("Roll? [y]/n: ")

if user_input and user_input.lower() == "y": # If it isn't empty and equals 'y'
    do()<jupyter_output>Roll? [y]/n: y
5
{'fraction_non_alphanumeric': 0.16348773841961853, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 6.0, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '481572', 'license': 'MIT', 'n_tokens_mistral': 300, 'n_tokens_neox': 292, 'n_words': 57, 'path': '100/dice/dice.ipynb', 'repo_name': 'ribonsAMR/PythonProjects', 'size': '734'}