generate a random t-shirt size for my story in python

You can use the random module in Python to randomly select a T-shirt size from a list of sizes. Here is an example function that you can use:

main.py
import random

def get_random_tshirt_size():
    sizes = ["S", "M", "L", "XL", "XXL"]
    return random.choice(sizes)
118 chars
6 lines

The get_random_tshirt_size function defines a list of T-shirt sizes and returns a random size from that list using random.choice. You can call this function whenever you need a random T-shirt size in your story.

Here's an example usage:

main.py
random_size = get_random_tshirt_size()
print("The random T-shirt size is:", random_size)
89 chars
3 lines

This will output something like:

main.py
The random T-shirt size is: XL
31 chars
2 lines

gistlibby LogSnag