05 Feb Markham Saturday 9:30 Python Homework 02.01.
Question:
Create a Tank object which have the attributes of:
- name
- direction(up/down/left/right)
- x position and
- y position
The object also have a method:
- move (direction, steps)
Using __init__ to Initial the tank to make sure it start from x position of 0 and y position of 0
Use print(tank object) to print out the tank’s current x and y position after each move. (need to overwrite __str__(self) method
Sorry, the comment form is closed at this time.