Python Classroom Series – 05/Jun/2021

Hacker Rank Problem for Leap Year

Inner Functions

  • We can define a function within another function
def outer(a, b):
    def inner(c,d):
        return c+d
    return inner(c,d)
  • Lets try to use inner function to print the prime numbers from 100 to 10000
  • An inner function can be useful when performing complex task more than once within a function, To avoid code loops or duplication we can use inner functions
  • Refer Here

Other Aspects of functions for future

  • Closures
  • Lambda
  • Decorators
  • Generators

Relook at investment Calculator

  • Write a python program which accepts

    • principal from the user
    • time in years
    • Support the following investments
      • Fixed Deposit:
        • State Bank of India: 5.15%
        • HDFC: 4.75
      • Mutual Funds:
        • Try to accommodate at least 3 mutual funds from Refer Here
          • SBI Contra Fund: 14.79%
          • Quant Tax Plan: 24.11 %
          • Canara Robeco Bluechip Equity: 18.11 %
      • Gold:
        • Ornament: 7.4%
        • ETF: 7.5%
  • Refer Here for the code written in the class

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin