Skip to content
Felix
  • Topics
    • My List
    • Felix Guide
    • Asset Management
    • Coding and Data Analysis
      • Data Analysis and Visualization
      • Financial Data Tools
      • Python
      • SQL
    • Credit
      • Credit Analysis
      • Restructuring
    • Financial Literacy Essentials
      • Financial Data Tools
      • Financial Math
      • Foundations of Accounting
    • Industry Specific
      • Banks
      • Chemicals
      • Consumer
      • ESG
      • Insurance
      • Oil and Gas
      • Pharmaceuticals
      • Project Finance
      • Real Estate
      • Renewable Energy
      • Technology
      • Telecoms
    • Introductory Courses
    • Investment Banking
      • Accounting
      • Financial Modeling
      • M&A and Divestitures
      • Private Debt
      • Private Equity
      • Valuation
      • Venture Capital
    • Markets
      • Economics
      • Equity Markets and Derivatives
      • Fixed Income and Derivatives
      • Introduction to Markets
      • Options and Structured Products
      • Other Capital Markets
      • Securities Services
    • Microsoft Office
      • Excel
      • PowerPoint
      • Word & Outlook
    • Professional Skills
      • Career Development
      • Expert Interviews
      • Interview Skills
    • Risk Management
    • Transaction Banking
    • Felix Live
  • Pathways
    • Investment Banking
    • Asset Management
    • Equity Research
    • Sales and Trading
    • Commercial Banking
    • Engineering
    • Operations
    • Private Equity
    • Credit Analysis
    • Restructuring
    • Venture Capital
    • CFA Institute
  • Certified Courses
  • Ask An Instructor
  • Support
  • Log in
  • Topics
    • My List
    • Felix Guide
    • Asset Management
    • Coding and Data Analysis
      • Data Analysis and Visualization
      • Financial Data Tools
      • Python
      • SQL
    • Credit
      • Credit Analysis
      • Restructuring
    • Financial Literacy Essentials
      • Financial Data Tools
      • Financial Math
      • Foundations of Accounting
    • Industry Specific
      • Banks
      • Chemicals
      • Consumer
      • ESG
      • Insurance
      • Oil and Gas
      • Pharmaceuticals
      • Project Finance
      • Real Estate
      • Renewable Energy
      • Technology
      • Telecoms
    • Introductory Courses
    • Investment Banking
      • Accounting
      • Financial Modeling
      • M&A and Divestitures
      • Private Debt
      • Private Equity
      • Valuation
      • Venture Capital
    • Markets
      • Economics
      • Equity Markets and Derivatives
      • Fixed Income and Derivatives
      • Introduction to Markets
      • Options and Structured Products
      • Other Capital Markets
      • Securities Services
    • Microsoft Office
      • Excel
      • PowerPoint
      • Word & Outlook
    • Professional Skills
      • Career Development
      • Expert Interviews
      • Interview Skills
    • Risk Management
    • Transaction Banking
    • Felix Live
  • Pathways
    • Investment Banking
    • Asset Management
    • Equity Research
    • Sales and Trading
    • Commercial Banking
    • Engineering
    • Operations
    • Private Equity
    • Credit Analysis
    • Restructuring
    • Venture Capital
    • CFA Institute
  • Certified Courses
Felix
  • Data
    • Company Analytics
    • My Filing Annotations
    • Market & Industry Data
    • United States
    • Relative Valuation
    • Discount Rate
    • Building Forecasts
    • Capital Structure Analysis
    • Europe
    • Relative Valuation
    • Discount Rate
    • Building Forecasts
    • Capital Structure Analysis
  • Models
  • Account
    • Edit my profile
    • My List
    • Restart Homepage Tour
    • Restart Company Analytics Tour
    • Restart Filings Tour
  • Log in
  • Ask An Instructor
    • Email Our Experts
    • Felix User Guide
    • Contact Support

Python Objects

Learn the basics of coding in Python. Starting with calculations, text, dynamic outputs, and variables in code.

Unlock Your Certificate   
 
0% Complete

20 Lessons (54m)

Show lesson playlist
  • Description & Objectives

  • 1. Python Objects Learning Objectives

    00:22
  • 2. Python Object Types

    03:42
  • 3. Object Type Workout

    00:51
  • 4. Lists

    04:05
  • 5. Accessing List Objects

    04:19
  • 6. Lists Workout

    05:04
  • 7. Changing List Objects

    02:54
  • 8. More List Functions

    02:05
  • 9. List Functions Workout

    03:01
  • 10. Tuples

    02:13
  • 11. Sets

    01:58
  • 12. Using Sets to Remove Duplicates

    02:09
  • 13. Set Operations

    03:08
  • 14. Sets Workout

    03:01
  • 15. Dictionaries

    03:02
  • 16. Accessing Dictionary Items

    01:43
  • 17. Dictionary Workout

    04:32
  • 18. Dictionary Functions

    03:14
  • 19. Dictionary Functions Workout

    01:55
  • 20. Python Objects Review

    01:00

Prev: Intro to Python Next: Custom Functions, For Loops, Conditional Logic

Dictionary Workout

  • Notes
  • Questions
  • Transcript
  • 04:32

How to create a dictionary in Python using data from a table.

Downloads

No associated resources to download.

Glossary

dictionary Python
Back to top
Financial Edge Training

© Financial Edge Training 2025

Topics
Introduction to Finance Accounting Financial Modeling Valuation M&A and Divestitures Private Equity
Venture Capital Project Finance Credit Analysis Transaction Banking Restructuring Capital Markets
Asset Management Risk Management Economics Data Science and System
Request New Content
System Account User Guide Privacy Policy Terms & Conditions Log in
Transcript

What you're going to do is you're gonna take the data in this data table and put it into a dictionary in Python, in the form of a key that is the company ticker in, in a string format, and then a list containing the current price and the first year price target. And once you get that all into a dictionary, you're going to print out one of the lists and you're gonna print out a specific object within one of the lists. I'm gonna show you this data again right now. We're gonna go, give you a little more thorough explanation of what you need to do in this exercise.

In your Jupyter Notebook complete the following steps. First, you're gonna define six lists using the data table I just showed you, and you're gonna see it again at the end of this explanation. Use the company tickers for variable names. And remember when you're defining a variable, this is not a string. You use plain text followed by the equal sign, and then whatever you want to be in that variable, which in this case is a list. The first object in each list should be the company's current price, which you're gonna see again at the data table. I'm gonna show you after this explanation. And the second object in each list should be the price target. After you create those six lists, you're gonna create a dictionary called Price Dict, and that dictionary is going to contain six different items or six different key value pairs. The key for each item should be a string of the company's ticker. And the value for each item should be the list that you defined in step one. Remember, each key value pair is separated by a colon, and each key value pair must be followed by a comma before you type in the next key value pair. If you don't remember the colon and the comma, the dictionary will not work. So your key is gonna be the string of the company's ticker, and the value is just gonna be the name of the variable you defined with those six lists. Once you have your list created and your dictionary defined, you're going to print out the entire value for PFE, which is Pfizer, and then you're gonna print out only the price target for Amgen, AMGN. And you're gonna do that by referring to the index of the list in the value. Again, here's the data that you're gonna need to create your list and your dictionary.

I've gone ahead and completed step number one, which was completing the six lists for each of these companies containing their current price and their price target. Let's put those values into a dictionary.

I'm gonna start by opening with a curly brace and then hitting intern. When I do that, it's gonna automatically indent, in my key for each of these is going to be a string of the ticker, and then I put a colon, and then the value that that matches that key. And in this case, it's just gonna be the list that I defined as J and J, that and then a comma, and then I move on to the next key value pair. The next item in that dictionary, which in this case is UNH and so on. And for the last item, you do not need a comm after it because there's nothing coming behind it. Now that that dictionary is defined, I can print the entire value for Pfizer by typing the name of the dictionary, and then in square brackets the key. And then I can print only the price target for Amgen by typing the name of my dictionary in square brackets the key. And that alone would give me the value. I know the value that's attached to that key is this list right here. So then if I add the index for the value that I want, which is the price target, so that's in the second position index one, it's gonna give me this 205 right here. So I'm gonna execute that cell.

And I've made a critical mistake here, which is I've forgotten to use the print function. And if you forget the print function, then it's only going to give you the last line. So let's add those.

I now, when I print it, I can see I'm getting this Pfizer list right here, and that's flowing into this first line of my output. And then I'm getting that 205 price target for Amgen.

Content Requests and Questions

You are trying to access premium learning content.

Discover our full catalogue and purchase a course Access all courses with our premium plans or log in to your account
Help

You need an account to contact support.

Create a free account or log in to an existing one

Sorry, you don't have access to that yet!

You are trying to access premium learning content.

Discover our full catalogue and purchase a course Access all courses with our premium plans or log in to your account

You have reached the limit of annotations (10) under our premium subscription. Upgrade to unlock unlimited annotations.

Find out more about our premium plan

You are trying to access content that requires a free account. Sign up or login in seconds!

Create a free account or log in to an existing one

You are trying to access content that requires a premium plan.

Find out more about our premium plan or log in to your account

Only US listed companies are available under our Free and Boost plans. Upgrade to Pro to access over 7,000 global companies across the US, UK, Canada, France, Italy, Germany, Hong Kong and more.

Find out more about our premium plan or log in to your account

A pro account is required for the Excel Add In

Find out more about our premium plan

Congratulations on completing

This field is hidden when viewing the form
Name(Required)
This field is hidden when viewing the form
Rate this course out of 5, where 5 is excellent and 1 is terrible.
Were the stated learning objectives met?(Required)
Were the stated prerequisite requirements appropriate and sufficient?(Required)
Were the program materials, including the qualified assessment, relevant and did they contribute to the achievement of the learning objectives?(Required)
Was the time allotted to the learning activity appropriate?(Required)
Are you happy for us to use your feedback and details in future marketing?(Required)

Thank you for already submitting feedback for this course.

CPE

What is CPE?

CPE stands for Continuing Professional Education, by completing learning activities you earn CPE credits to retain your professional credentials. CPE is required for Certified Public Accountants (CPAs). Financial Edge Training is registered with the National Association of State Boards of Accountancy (NASBA) as a sponsor of continuing professional education on the National Registry of CPE Sponsors.

What are CPE credits?

For self study programs, 1 CPE credit is awarded for every 50 minutes of elearning content, this includes videos, workouts, tryouts, and exams.

CPE Exams

You must complete the CPE exam within 1 year of accessing a related playlist or course to earn CPE credits. To see how long you have left to complete a CPE exam, hover over the locked CPE credits button.

What if I'm not collecting CPE credits?

CPE exams do not count towards your FE certification. You do not need to complete the CPE exam if you are not collecting CPE credits, but you might find it useful for your own revision.


Further Help
  • Felix How to Guide walks you through the key functions and tools of the learning platform.
  • Playlists & Tryouts: Playlists are a collection of videos that teach you a specific skill and are tested with a tryout at the end. A tryout is a quiz that tests your knowledge and understanding of what you have just learned.
  • Exam: If you are collecting CPE points you must pass the relevant CPE exam within 1 year to receive credits.
  • Glossary: A glossary can be found below each video and provides definitions and explanations for terms and concepts. They are organized alphabetically to make it easy for you to find the term you need.
  • Search function: Use the Felix search function on the homepage to find content related to what you want to learn. Find related video content, lessons, and questions people have asked on the topic.
  • Closed Captions & Transcript: Closed captions and transcripts are available on videos. The video transcript can be found next to the closed captions in the video player. The transcript feature allows you to read the transcript of the video and search for key terms within the transcript.
  • Questions: If you have questions about the course content, you will find a section called Ask a Question underneath each video where you can submit questions to our expert instructor team.