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

Intro to Python

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

Unlock Your Certificate   
 
0% Complete

13 Lessons (36m)

Show lesson playlist
  • Description & Objectives

  • 1. Introduction to Python Learning Objectives

    00:23
  • 2. Python Fundamentals Introduction

    01:08
  • 3. Downloading Anaconda

    02:02
  • 4. Introducing Jupyter Notebook

    02:42
  • 5. Calculations

    00:57
  • 6. Calculations Workout

    01:43
  • 7. Mathematical Operators

    01:26
  • 8. Text Outputs

    03:21
  • 9. Dynamic Outputs

    02:22
  • 10. Text Workout

    03:34
  • 11. Variables

    05:01
  • 12. Variables Workout

    11:36
  • 13. Introduction to Python Review

    00:26

Next: Python Objects

Variables

  • Notes
  • Questions
  • Transcript
  • 05:01

Learn how to include variables in the format function in Python to dynamically input values into output.

Downloads

No associated resources to download.

Glossary

Coding dynamic inputs Jupyter Notebook Python Variables
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

Alright, thanks for completing that exercise and also thank you for hanging in there with me up until this point, I know the fundamentals of Python are not the most exciting part, but they are an important building block as you move toward more complex machine learning analyses. So right now we're going to move on to including variables in that format function, like I alluded to in the previous section. So here I have a piece of text that I'm trying to print using the format function that's showing me price, EPS and a PE multiple. And right here I have a space to define a variable P and to define a variable EPS. So I'm going to go ahead and I'm gonna give that P a value of 220 and I'm gonna give the EPS a value of 10 as if we're looking at a stock where the price is $220 and the earnings per share is $10. Now I'm gonna complete this line of text down here, and since this first set of curly braces is price, the second set of curly braces is EPS. And the last one is the price to earnings multiple. I'm gonna input these variables in my format, parentheses in that order. And instead of writing 220, 10 and then two 20 divided by 10, I'm just gonna put the variable P and then a comma the variable EPS in a comma, and then I'm gonna divide P by EPS. Now when I execute that, it's going to neatly put these all into one output. And the really nice thing is this shows you how you can use code to, to give a value to these variables and then input that dynamically into your output. So if I wanted to, I could change this definition to what do I wanna say, 22 times 10, or if I had some sort of an algorithm that was determining the price of that stock. So now I can hit shift enter to execute again, and it still goes all the way through. You can see that my price is 220, this division equation is working correctly. And that's how you can start to build a little bit more complex pieces of code is by using variables and using format to input those dynamic values into an output.

So you are not limited to using numerical values when you define these variables. So with P, I've used an equation 22 times 10 EPS is a numerical value, but I could create let's say M for our multiple and I could set that equal to an equation involving two variables, so our P and our EPS and now down here in my format function, I can change that equation to simply M and execute it and it's going to give the same exact result. Or alternatively, If I wanted that to be text, for example, I could set that using text and I could set this using text.

I can't do an equation between two pieces of text, so I'm gonna go ahead and change that to 22, and now these pieces of text will flow through my format. If I execute this code cell, I'm gonna get the same exact result. The difference is that now because these are text variables, I'm not gonna be able to perform the same mathematical operations between them, but I just do this to show you that you can define your variables as many different kinds of data. I want to give you one final piece of advice before we go on to the exercise for this section, and that is to use informative variable names when you're creating new variables. So here is an example of uninformative variable names. We've just named these variables B, C, D, A, and then down here you can see some sort of a formula is happening. It's not obvious what's going on. If I've never seen this before, if I wrote this in the past, I might look back on it a few months later and be confused about what it's about. Or if I'm giving it to one of my coworkers, it might be difficult for them to understand at first glance without me being there to explain it to them. So the code will work correctly. But because of these uninformative variable names, I might run into some problems down the road. Instead of that, if I were to give these descriptive variable names, now all of a sudden you can recognize this as the compound annual growth rate formula. And if I write it now and I don't look at it for six months, I'm gonna come back and I'm gonna immediately recognize that this is kegger. And if I send it to one of my coworkers, they're going to immediately recognize this is something familiar. I know what's going on here. Now if I execute this, all of the code is gonna work exactly the same. But because I gave these informative variable names, it's much easier for me to understand down the road the logic of my code. And it's much easier for other people to very intuitively understand what I'm coding.

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.