Showing posts with label #python #programming #computer #code #graphics #draw #circle. Show all posts
Showing posts with label #python #programming #computer #code #graphics #draw #circle. Show all posts

Wednesday, 2 March 2022

Python Program Put a Textual Label inside red circle

SCREENSHOT



CODE

 #Draw a red circle centered at point (100,100) with radius 50 and with text Red Circle

from graphics import *

def main():

    win = GraphWin('Draw Circle',300,300)

    

    center = Point(100,100) 

    circ = Circle(center, 50) 

    circ.setFill('red') 

    circ.draw(win)


    label = Text(center, "Red Circle") 

    label.draw(win)

main()


Python Program Draw a red circle centered at point (100,100) with radius 30

SCREENSHOT



CODE

 #Draw a red circle centered at point (100,100) with radius 30

from graphics import *

def main():

    win = GraphWin('Draw Circle',300,300)

    center = Point(100,100) 

    circ = Circle(center, 30) 

    circ.setFill('red') 

    circ.draw(win)

main()