मराठी

Write the insertion operation of queue containing character using class.

Advertisements
Advertisements

प्रश्न

Write the insertion operation of queue containing character using class.

कोड लेखन
Advertisements

उत्तर

class CharacterQueue:
    def __init__(self):
        self.queue = []

    def insertion(self, character):
        self.queue.append(character)  # Add at the rear
        print("Character inserted")


characters = CharacterQueue()
characters.insertion("A")
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Stacks & Queues in list - EXERCISE [पृष्ठ १२३]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
पाठ 6 Stacks & Queues in list
EXERCISE | Q 14. | पृष्ठ १२३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×