Exercise

Branching with elif and else

elif and else statements let you extend your code to handle cases not handled by your initial control statement. In this exercise you will sort security transactions based on their stock symbol. You might do this to better understand how some popular stocks are bought and sold. You are provided with the variable trn which holds the transaction, and the empty lists appl, tsla, and amzn to hold sorted transactions.

Instructions 1/3

undefined XP
    1
    2
    3
  • If the symbol is 'APPL', add it to the list appl