from graphics import * def main(): wn = GraphWin() x = 30 y = 40 for i in ['green','red','blue','white','black']: x = x + 10 y = y + 20 tt = Rectangle(Point(x,y),Point(x+10,y+10)) tt.setFill(i) tt.draw(wn) wn.getMouse() wn.getMouse() wn.close() main()
for i in range(5): print("*") # each print gives a newline character at the end
for i in range(3): n = int(input("Enter a number ")) print (n*3,"is three times as much as",n)
ctr = 3 for i in range(5): ctr = ctr + 3
tot = 0 for i in range(5): tot = tot + i
fct = 1 n = int(input("Factorial of what number? ")) for i in range(2,n+1): fct = fct * i
tom = Line() joe = tom
tom = Line() joe = Line()