TORONTO KIDS COMPUTER CLUB | Sunday 12:00 Python Homework 11.04.
15923
post-template-default,single,single-post,postid-15923,single-format-standard,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Sunday 12:00 Python Homework 11.04.

06 Nov Sunday 12:00 Python Homework 11.04.

Question:

Create a Tank object which have the attributes of:

  • name
  • direction(up/down/left/right)
  • x position and
  • y position

The Tank 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

Print out the tank’s current x and y position after each move.

No Comments

Sorry, the comment form is closed at this time.