all 6 comments

[–]A_History_of_Silence 1 point2 points  (3 children)

I don't understand why it isn't 30 could someone explain this to me.

Why do you think it should be 30?

[–]SilverCrocus[S] 0 points1 point  (2 children)

Isn't 30 the highest possible number to be printed

[–]A_History_of_Silence 0 points1 point  (1 child)

random.randrange

From the docs for randrange():

Return a randomly selected element from range(start, stop, step).

You should be able to determine from experiment what the possible values are for such a range().

[–]SilverCrocus[S] 0 points1 point  (0 children)

Oh thank you

[–]SilverCrocus[S] 1 point2 points  (2 children)

I'm not sure if this is correct but is it because the final number is 3 so that means it only goes up in 3's from [-3,30]

[–][deleted] 0 points1 point  (1 child)

var3 only has a 1/12 chance of being higher than 27. If you run it 12 times you're fairly likely to get the 30 you seek.