title: How to check if a dictionary has the same elements wanted from a list?
body: <p>I am working on creating a service menu where the user gets to choose which service he wants and add it to a list.</p>
  <p>After the user has chosen the services he wants, he would then proceed to checkout where the total price of those services is added together and he pays.</p>
  <p>I currently have a function that gets and stores the services that the user wants from a dictionary:</p>
  <pre><code>userInput = &quot;&quot;
  
  servicesAvailableFull = {'Firewall Service' : 1.2, 'Security Ops Centre' : 4.2,
                           'Hot Site' : 8.5}
  servicesAvailable = [&quot;Firewall Service&quot;, &quot;Security Ops Centre&quot;, &quot;Hot Site&quot;]
  userAddedServices = []
  
  print(&quot;+++ Welcome to Electronic Services and Protection: +++&quot;)
  
  while userInput != &quot;Q&quot;:
      menu()
      userInput = input(&quot;Please input your choice of action ('Q' to exit):  &quot;)
  
      if userInput == &quot;1&quot;:
          displayServices(servicesAvailableFull , servicesAvailable, userAddedServices)
          print(userAddedServices)
  
      elif userInput == &quot;4&quot;:
          payment(userAddedServices, servicesAvailableFull)
  
  
  def displayServices(availServiceFull, availService, serviceToAdd):
      userInput = &quot;&quot;
      counter = 1
      elementToTransfer = &quot;&quot;
      while userInput != &quot;Q&quot;:
          print(&quot;\n&quot;)
          print(&quot;Yes, we have the following service(s): &quot;)
          for x, service in availServiceFull.items():
              print(f&quot; {counter}.  {x}   : ${service}/year&quot;)
              counter += 1
          userInput = input(
              &quot;Enter the service(s) that you would like to add, or 'Q' to stop: &quot;)
          try:
              if userInput.isnumeric()==False:
                  raise ValueError
              #elif int(userInput) &gt; int(len(userAddedServices)) or int(userInput) &lt;= 0:
              #   raise ValueError
              else:
                   elementToTransfer = availService[int(userInput) - 1]
                   if elementToTransfer in serviceToAdd:
                      print(&quot;Sorry, you added that service already.&quot;)
                      counter = 1
                      continue
                   else:
                      serviceToAdd.append(elementToTransfer)
                      print(serviceToAdd)
                      counter = 1
  
          except ValueError:
              counter = 1
              print(&quot;Please enter a numeric value&quot;)
  </code></pre>
  <p>Right now I have a list which contains the services the user wants to add, and a dictionary containing both the services and the price of the services.</p>
  <p>I am currently working on the <code>payment()</code> function, but I am not sure how to get the program to print out both the services the user wants to add and their corresponding price.</p>
  <p>Like this:</p>
  <ol>
  <li>Firewall Service: $1.2k/year</li>
  <li>Security Ops    : $4.2k/year</li>
  </ol>
  <p>I am able to print from the list containing the user added services, but I am unsure how to access the prices from the dictionary.</p>