This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------- | |
# Name: module1 | |
# Purpose: | |
# | |
# Author: reevesj | |
# | |
# Created: 07/05/2011 | |
# Copyright: (c) reevesj 2011 | |
# Licence: <your licence> | |
#------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
class Shape: | |
def __init__(self, dim1, dim2): | |
self.dim1=dim1 | |
self.dim1=dim2 | |
def area(self): | |
return self.dim1*self.dim2 | |
def perimeter(self): | |
return 2*(self.dim1+self.dim2) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
#import libraries | |
from tkinter import * | |
from random import randint | |
c_width,c_height=600,600 | |
col="black" | |
colours = ["red", "orange", "yellow", "green", "blue", "purple"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
from tkinter import * | |
window=Tk() | |
canvas=Canvas(height=400,width=600,bg="black") | |
#canvas.create_line(x0,y0,x1,y1) | |
canvas.create_line(0,0,600,400,fill="blue",width=200) | |
canvas.create_line(600,0,0,400,fill="blue",width=200) |
NewerOlder