-
Notifications
You must be signed in to change notification settings - Fork 1
/
day_16.py
36 lines (23 loc) · 830 Bytes
/
day_16.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from prettytable import PrettyTable
import turtle
from turtle import Screen
### OOP principles ###
### using Turtle for practice purposes ###
### using Prettytable for practice purposes ###
""" practice class attributes and method passing - https://docs.python.org/3/library/turtle.html """
""" practice class and object manipulation - https://pypi.org/project/prettytable/ """
benjamin = turtle.Turtle()
print(benjamin)
my_screen = Screen()
print(my_screen.canvheight)
benjamin.shape("turtle")
benjamin.color("blue1")
benjamin.forward(100)
### method = function tied to an object ###
my_screen.exitonclick()
# new object
table = PrettyTable()
table.add_column("City", ["Tokyo", "London", "Berlin"])
table.add_column("Move to", ["Yes", "No", "No"])
table.align = "l"
print(table)