#Can someone help me understand this task ? Chaitana's Colossal Coaster

3 messages · Page 1 of 1 (latest)

terse dragon
#

Define the add_me_to_the_queue() function that takes 4 parameters <express_queue>, <normal_queue>, <ticket_type>, <person_name> and returns the appropriate queue updated with the person's name.

<ticket_type> is an int with 1 == express_queue and 0 == normal_queue.
<person_name> is the name (as a str) of the person to be added to the respective queue.

add_me_to_the_queue(express_queue=["Tony", "Bruce"], normal_queue=["RobotGuy", "WW"], ticket_type=1, person_name="RichieRich")
...
["Tony", "Bruce", "RichieRich"]

add_me_to_the_queue(express_queue=["Tony", "Bruce"], normal_queue=["RobotGuy", "WW"], ticket_type=0, person_name="HawkEye")
....
["RobotGuy", "WW", "HawkEye"]
/

#

ticket_type = 0, 1

if ticket_type[0]:
    normal_queue.append(person_name)
    return normal_queue
else:
    express_queue.append(person_name)
    return(express_queue)
#

i thought the idea was to check if someone has an express ticket or a normal ticket and add them to a corresponding queue