Let's say I have a variable named job1, where job1 is equal to "Salesman".
Now let's say I have another variable named job2 which is equal to "Chef".
I add 10 more jobs (job3, job4, etc..) and want to cycle through them randomly based on the number attached to them.
would it be possible for me to search randomly based on a random number generator? Generate a random number 1-10 and tack the number given onto the end of the job variable to find that specific one?
sample would look like this:
choice = random.randint(1, 4)
job1 = "salesman"
job2 = "chef"
job3 = "driver"
job4 = "waiter"
'''here is where I want to take the random number and put it on the end of job to get job1, job2, job3, job4, etc. and print it'''
I'm sure there's an easier way of doing this but is there a possible way for what I'm inquiring?
Thanks for your time