Week 2: Python Basics: Variables, Data Types, and Operations

Learn the fundamental building blocks of Python programming with a focus on financial calculations.

Learning Objectives:

Exercises:

  1. Create variables of different data types (int, float, string) to store financial data:
    • Stock price (float)
    • Number of shares (int)
    • Company ticker symbol (string)
  2. Write a program that calculates the total value of a stock position (price × number of shares)
  3. Create a simple interest calculator that takes principal, rate, and time as inputs
  4. Write a program that converts currency (e.g., USD to EUR) using a fixed exchange rate
  5. Create a program that calculates the future value of an investment after n years
  6. Write a program that calculates monthly loan payments given principal, interest rate, and years

💡 ChatGPT Learning Tips

Use these prompts to enhance your learning:

  1. "Explain Python data types using financial examples (stock prices, share counts, company names)"
  2. "Show me how to write a simple interest calculator in Python and explain each variable type"
  3. "What are the common mistakes when working with floating-point numbers in financial calculations?"
  4. "How do I format currency output in Python to show exactly 2 decimal places?"
← Previous Week | Next Week →
← Back to Home