TORONTO KIDS COMPUTER CLUB | Monday 20:00 Python Practice 20.11.02.
18561
post-template-default,single,single-post,postid-18561,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Monday 20:00 Python Practice 20.11.02.

03 Nov Monday 20:00 Python Practice 20.11.02.

Question:
Create a Time class and initialize it with hours and minutes.

  • Make a method addTime which should take two time object and add them. E.g.- (2 hour and 50 min)+(1 hr and 20 min) is (4 hr and 10 min)
  • Make a method displayTime which should print the time.
  • Make a method DisplayMinute which should display the total minutes in the Time. E.g.- (1 hr 2 min) should display 62 minute.

1Comment
  • Jesse Shi
    Posted at 00:44h, 10 November Reply

    class Time:
    def __init__(self, hour = 0, minute = 0):
    self.time = time
    self.hour = hour
    self.minutes = minutes
    self.addTime = addTime
    self.displayTime = displayTime
    self.displayMinute = displayMinute

    def __str__(self.displayMinute):
    hour * 60 + minutes = totalmin
    print(‘Omg, you have’ , totalMinutes, ‘ in total!’)

    def addTime(time):
    hour + minute = totaltime
    print(‘You have’, totaltime, ‘ left! Wahahahahaahahahahahahahahaahahahahahahahaha!!’)

Post A Comment