我想画一幅中间有一个黑色圆圈的画。你知道吗
def Circle():
pic=makeEmptyPicture(200,200)
centre=(100,100)
for y in range (0,200):
for x in range (0,200):
value =int[( 200/(100-y^2)^.5)]
if value!= 0 and x <=value:
px=getPixel(pic,x,y)
setColor(px, makeColor(0,0,0))
return(pic)
我得到The error was: 'int' and 'float'
我不知道如何将value解析为int
像函数调用一样使用括号而不是方括号。而且
^
(按位异或)应该是**
(指数)。你知道吗我的代码逻辑有缺陷:
我保留目前的答案,作为答案,因为它处理我的问题,我觉得有义务张贴一个替代解决我的问题。你知道吗
相关问题 更多 >
编程相关推荐