Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ADT related stacks
#6
Create the size() function. This function should take a queue and return the number of elements it currently contains.

1.Define a function called size()
2.It should take one argument: queue
3.Return len of the queue - which is the argument for this function
Quote:def size(self):
    return len(self.queue)
Reply


Messages In This Thread
ADT related stacks - by prasanthbab1234 - Oct-12-2020, 04:33 PM
RE: ADT related stacks - by buran - Oct-12-2020, 05:52 PM
Adding new items to queue - by prasanthbab1234 - Oct-12-2020, 04:52 PM
Removing items from queue - by prasanthbab1234 - Oct-12-2020, 05:03 PM
take a queue and return the number of elements it currently contains. - by prasanthbab1234 - Oct-12-2020, 05:35 PM
RE: Removing items from queue - by deanhystad - Oct-12-2020, 05:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Expression Evaluation Using Stacks walrus_overlord2 3 7,637 Apr-15-2020, 11:19 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020