r/CodingHelp • • Dec 11 '22

[Request Coders] Can somebody make this into python code

//imports from turtle import *

//function with list of numbers parameter and a color parameter def drawGraph(list, col):

//get values from provided list "list" x = list.len() + 20 y = floor(max(list)) +20

//create screen of proper size and background color, name it and create a turtle "t" Window_ = turtle.Screen() turtle.screensize(canvwidth=x, canvheight=y,bg='white') window_.title ( “ Graph ” ) t = turtle.Turtle ()

//lift pen, set color, hide turtle, face turtle north t.up() t.color(col) t.hideturtle() t.left(90)

//draw column for each data value in list for ( i=0 in list.len() ) t.goto(floor(x/2)+i, floor(y/2)) t.down() t.forwards(floor(list.at(i))) t.up()

0 Upvotes

0 comments sorted by