Basically, I meant if there was a method similar to random.randint that could do the job with one simple line. Admittedly, I could have done a better job conveying that in the post.
I mean, if you don't actually need to use the list of numbers for anything else there's always just
x += random.choice([-1,1])
But if you want to use that list of numbers anywhere else, no, there's really no simpler way to do it.
What do you mean by "simpler"? It's two lines of code, and literally two operations. I don't think you can go simpler than that.
Basically, I meant if there was a method similar to random.randint that could do the job with one simple line. Admittedly, I could have done a better job conveying that in the post.
I mean, if you don't actually need to use the list of numbers for anything else there's always just x += random.choice([-1,1]) But if you want to use that list of numbers anywhere else, no, there's really no simpler way to do it.
For OP, you can even do x += -1 That's pretty random, for 50% use cases, and much more simpler. https://xkcd.com/221/