from visual import * from random import * scene = display(title='Cantor Set', width=800,height=800, center=(0.5,0,0),range=0.6) x=0.0 y=0.0 n=0 while n<10000: n=n+1 RandomNumber=random() if RandomNumber<=0.5: x=0.333*x y=0 if RandomNumber>0.5: x=0.333*x+0.666 y=0 dot=sphere(pos=(x,y), radius=0.002)