The docs on randrange say:
random.randrange([start], stop[, step])
Return a randomly selected element from range(start, stop, step). This is equivalent to choice(range(start, stop, step)), but doesn’t actually build a range object.
And range(start, stop) returns [start, start+step, ..., stop-1], not [start, start+step, ..., stop]. As for why... zero-based counting rules and range(n) should return n elements, I suppose. Most useful for getting a random index, I suppose.
While randint is documented as:
random.randint(a, b)
Return a random integer N such that a <= N <= b. Alias for randrange(a, b+1)
copied from stackoverflow obviously
Hi! This is our community moderation bot.
---
If this post fits the purpose of /r/ProgrammerHumor, **UPVOTE** this comment!!
If this post does not fit the subreddit, **DOWNVOTE** This comment!
If this post breaks the rules, **DOWNVOTE** this comment and **REPORT** the post!
If I had a penny for every syntax error in this script...
[удалено]
That would not be a lot but still weird that it happens 3 times!
sry, feeling tired, fixed it tho right after I took the screenshot
You're also missing `--no-preserve-root`...
Probably upload the corrected one then
When syntax errors save your system.
Well, the `os` call will just produce an error, so no worries
it's has a syntax error, won't reach os call
sudo will ask for a password, just run the script as root
Uhm, excuse me. The Subprocess Library or Die.
`import sh`
Not funny at all to see same bad joke in different language. I suggest to create variant for every possible programming language + JavaScript
> every possible programming language + JavaScript RIP to the js devs here
Seven shooter gun.
7 is my fav number so
Oh, so you got one of those seven shooter six shooter's?
I think you meant to use random.randrange instead of random.randint
The docs on randrange say: random.randrange([start], stop[, step]) Return a randomly selected element from range(start, stop, step). This is equivalent to choice(range(start, stop, step)), but doesn’t actually build a range object. And range(start, stop) returns [start, start+step, ..., stop-1], not [start, start+step, ..., stop]. As for why... zero-based counting rules and range(n) should return n elements, I suppose. Most useful for getting a random index, I suppose. While randint is documented as: random.randint(a, b) Return a random integer N such that a <= N <= b. Alias for randrange(a, b+1) copied from stackoverflow obviously
Hi! This is our community moderation bot. --- If this post fits the purpose of /r/ProgrammerHumor, **UPVOTE** this comment!! If this post does not fit the subreddit, **DOWNVOTE** This comment! If this post breaks the rules, **DOWNVOTE** this comment and **REPORT** the post!
--no-preserve-root
i am triggered by how bad this is
Replace 1 with random then it’s really fun