随机数和函数
问题描述:
大家好,我是python的新手,因此我只玩基本的编码/脚本。我今天花了很多时间使用随机数字。感谢您的所有意见和建议,这真的帮助我学习。我有一个新问题,我现在正在思考,我知道如何继续但是想提出这个问题以获得一些建议。
这是我正在尝试的到目前为止我已经想到了什么。
- 然后我希望脚本生成具有左上角和右下角边界的随机数。向量/坐标
- 因此,基本上没有随机生成的十进制数可以超出左上角和右下角的范围。坐标。
- 到目前为止,通过游戏我已经编写了以下代码,这要归功于在此论坛上从其他人的帮助中获得的知识。
- I then want the script to generate random numbers that are with the bounds of the "upper left and lower right" vectors/coordinates
- So, basically none of the randomly generated decimal numbers can go out of the bounds of the "upper left and lower right" coordinates.
- So far by playing around I have coded the following thanks to the knowledge gained from the help of others on this forum.
Hi everyone, I''m fairly new with python and as such am playing around alot with just basic coding/scripting. I''ve spent the better part of today working with random numbers. Thanks for all your comments and advice it''s really helped me to learn. I have a new question that I an thinking about right now, I have an idea of how to proceed but wanted to pose this question to get some advice.
Here is what I am trying to do and what I have figured out so far.
展开 | 选择 | Wrap | 行号
答
大家好,我对python很新,所以我正在玩很多基本的编码/脚本。我今天花了很多时间使用随机数字。感谢您的所有意见和建议,这真的帮助我学习。我有一个新问题,我现在正在思考,我知道如何继续但是想提出这个问题以获得一些建议。
这是我正在尝试的到目前为止我已经想到了什么。
- 然后我希望脚本生成具有左上角和右下角边界的随机数。向量/坐标
- 因此,基本上没有随机生成的十进制数可以超出左上角和右下角的范围。坐标。
- 到目前为止,通过游戏我已经编写了以下代码,这要归功于在此论坛上从其他人的帮助中获得的知识。
展开 | 选择 | Wrap | 行号
不要忘记''f.close''之后的''()''!怎么样:
Do not forget the ''()'' after ''f.close''! How about this:
展开 | 选择 | Wrap | 行号
不要忘记''()''之后'' f.close ''!怎么样:
Do not forget the ''()'' after ''f.close''! How about this:
展开 | 选择 | Wrap | 行号