腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
7
回答
random.randint
错误
、
我有一些代码,看起来像这样:while n <= 50: a =
random.randint
(1, 16) print n, ". ", a, "-", b, "= " 由于某些原因,在运行它时,我得到了以下
错误
:AttributeError: 'module' object has no但是,当我在IDLE中运行相同的
r
浏览 3
提问于2010-11-15
得票数 26
2
回答
ValueError:随机范围()的空范围(6,6,0)
我编写了这段代码,它一开始是工作的,但后来却出现了
错误
。解决不了这个问题。Ps:我对编程很陌生。import random a =
random.randint
(0,5) print(b) I得到了输出-2 ValueError回溯(最近一次调用),范围为(0,100):3a=
random.randint
(0,5) ->4b=
random.randint
(a+1,5) 5
浏览 5
提问于2020-05-22
得票数 1
2
回答
除非我使用变量,否则代码不起作用
、
、
但是为什么这样做是可行的: win = GraphWin("My Circles",500,500) cir1 = Circle(Point(x,y),8)cir1 = circle[((Point(
random.randint
(50,450)),
random.randint
(50,450)),8)]
浏览 2
提问于2015-07-09
得票数 0
3
回答
使用数组时出现索引
错误
!Python
我得到一个索引超出范围
错误
Using TrinketgeneSet = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ= target: guess[index] = random.choice(geneSet) print guess
浏览 6
提问于2018-05-12
得票数 0
4
回答
Python数字数组程序
这就是我到目前为止所知道的: c =
random.randint
(1,99) twainQuotes = [
random.randint
(b,c)] for i in
浏览 65
提问于2020-03-11
得票数 0
1
回答
字符串中存在语法
错误
当我运行这段代码时,我得到一个语法
错误
: Str =
random.randint
(3,18) Wis=
random.randint
(3,18) Con =
random.randint
(3,18) print "Typethe name of a stat (Str, Int, Wis, Ch
浏览 2
提问于2013-01-18
得票数 1
2
回答
TypeError:在*后面键入对象参数必须是可迭代的,而不是int
、
、
这是我的密码:但是,当我运行程序时,会出现以下
错误
: TypeError:在*后面键入对象参数必须是可迭代的
浏览 2
提问于2016-12-16
得票数 2
2
回答
Random.randient在函数中调用时显示
错误
、
、
、
嘿,我正在做一个游戏,我在游戏中做了一个函数,如果bg_object小于允许的数量对象的上限,我很快就实现了,但是我遇到了一个问题,问题是每当我试图在屏幕上模糊一个图像时,它就会显示一个
错误
,我知道在一个背景中将它放在一个多个对象的类中以下是功能:FlowerPos = [
random.randint
( SCREEN_WIDTH , SCREEN_HEIGHT ) ,
random.randint
( SCREEN_WIDTH , SCREEN_HEIGHT )] StonePos = [
浏览 2
提问于2022-07-28
得票数 0
回答已采纳
4
回答
如何在
random.randint
中添加异常?
、
如何在
random.randint
中添加异常呢?下面我要说的不是这样做: number =
random.randint
(0, 10) !
浏览 14
提问于2017-02-08
得票数 4
回答已采纳
1
回答
IndexError:使用随机模块时字符串索引超出范围
、
、
、
、
我正在用python制作密码生成器,这就是我一直坚持的
错误
。(): zero = 0 letter_index =
random.randint
random_letter()] password_generating() 我不得不说,
错误
非常随机地出
浏览 18
提问于2019-12-18
得票数 1
回答已采纳
2
回答
UnboundLocalError:赋值前引用的局部变量'n‘
、
我一直收到
错误
:"UnboundLocalError:在分配之前引用的局部变量‘音调’“,有什么方法可以解决这个问题吗?import winsound, random Duration =
random.randint
(100, 500) winsound.Beep(Pitch, Duration) Pitch =
random.randint
(10
浏览 4
提问于2015-12-21
得票数 1
回答已采纳
1
回答
当我调用随机整数时,为什么得到一个值
错误
?
当我打给布兰特的时候,我总是得到一个值的
错误
。我通过创建一个名为test_random_word的脚本来隔离这个问题。有人能解释这个
错误
的来源吗?dictionary of the requested length. length_of_list = len(dict[str(length)]) dict = CreateDictionary("20k.txt")
浏览 0
提问于2019-06-29
得票数 0
1
回答
python高级下博弈中的
错误
或语法
错误
我做了一个更高的下一个游戏,我有一个奇怪的语法
错误
。= game_data.data[
random.randint
(0,49)] er() Continue_Game == False 我在行global A_value = data[
random.randint
(0,49)]上得到了一个语法
错误
,奇怪的是,我没有在行得到这个
错误
,g
浏览 1
提问于2022-05-07
得票数 -1
1
回答
如何用PIL和numpy图像修复
错误
?
、
、
、
、
for col in len(original_image[1]): r =
random.randint
(1,255) b =
random.randint
(1,255) original_image
浏览 2
提问于2015-03-03
得票数 0
回答已采纳
1
回答
用Pyglet绘制基元
、
、
我一直收到这样的
错误
: ValueError:只能分配相同大小的序列。显然,我似乎定义了
错误
的顶点数,但计数对我来说是正确的,我不知道如何修正它。(0,window.width) x2=
random.randint
(0,window.width)y2=
random.randint
(0,window.height) coords.append(x); coords.append(y); coo
浏览 0
提问于2016-03-15
得票数 2
回答已采纳
2
回答
如何在Python中的字符串中包含整数?
import random w =
random.randint
(10, 100)r = int(input(e))>>> (60, ' * ', 24)>>> (60 * 24)import random q =
random.randint
(10
浏览 4
提问于2022-11-14
得票数 0
回答已采纳
1
回答
在python中每n次从多个fasta文件获取序列
、
、
、
、
outfile outlist = [] choose = [
random.randint
我想我的问题是:
错误
是: python fasta_extractor.py
浏览 1
提问于2021-08-20
得票数 0
3
回答
使骰子值在if语句中不重复
、
我希望我的骰子值而不是重复,因为当它重复时,它会在我的程序中注册一个
错误
的输入(不是崩溃,只是一个字符串消息,说明“您的输入是
错误
的”)。dice =
random.randint
(0,3) if dice == 0: elif dice == 1: guess = s
浏览 5
提问于2016-10-30
得票数 5
回答已采纳
4
回答
将变量(字母和数字)组合成python中的一个问题
、
要添加此操作,我的代码是:num2 = (
random.randint
(0,12))print(question)question = (num1 + "" + "+" + "" + num2) TypeError: unsupported
浏览 8
提问于2020-03-26
得票数 4
回答已采纳
1
回答
如何调试我的Python骰子游戏?
、
它随机生成并正确显示数字,程序似乎检查没有
错误
,除非最后两个playerDice元素匹配,然后抛出一个超出界限的
错误
,为什么要这样做?而且,它从来不显示最后的打印行有多少种类型,即使它运行无
错误
,为什么呢?以下是代码:playerDice = [
random.randint
(1,6),
random.randint
(1,6),
random.randint
(1,6),
random.randint
(1,6),
random.randint<
浏览 2
提问于2017-10-09
得票数 1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
战争雷霆错误代码,代码错误,连接错误?你先别慌。
WordPress 5.5 Sitemap错误导致404错误
命运2网络错误,网络连接错误,网络配置错误,办法在这里
steam登录出现错误?错误排查与解决方案
蓝色协议BlueProtocol错误/报错c+/错误代码102/错误代码169方法
热门
标签
更多标签
云服务器
ICP备案
对象存储
腾讯会议
云直播
活动推荐
运营活动
广告
关闭
领券