English

Write a function to add any customer's information to queue.

Advertisements
Advertisements

Question

Write a function to add any customer's information to queue.

Code Writing
Advertisements

Solution

customer_queue = []


def add_customer(name, customer_id, amount):
    customer = {
        "name": name,
        "customer_id": customer_id,
        "amount": amount,
    }
    customer_queue.append(customer)  # Add customer at the rear
    print("Customer information added")


add_customer("Arun", 501, 2500)
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Stacks & Queues in list - EXERCISE [Page 123]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 6 Stacks & Queues in list
EXERCISE | Q 25. | Page 123
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×