Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
297 views
in Technique[技术] by (71.8m points)

python - different result of random.randint() in Jupyter notebook and Thonny

here is the problem, according to this link: https://numpy.org/doc/1.19/reference/random/generated/numpy.random.randint.html?highlight=randint#numpy.random.randint

it says that: "numpy.random.randint(low, high=None, size=None, dtype=int) Return random integers from low (inclusive) to high (exclusive)."

then I run the following code in Thonny and Jupyter """ import random print(random.randint(1,3)) """

the result is:

  1. I can get 3 in Thonny
  2. But I cannot get 3 in Jypyter notebook, which seems correct, because the "high" parameter should be exclusive.

I am confusing about this now, is it the problem about about IDEs?

question from:https://stackoverflow.com/questions/65947681/different-result-of-random-randint-in-jupyter-notebook-and-thonny

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...