fb pixel

Introduction to Python

  • Profound Academy

    • Status
      • 1
        Input and Output
      • 2
        Variables and Integer Arithmetic
      • 3
        Conditional Operators
      • 4
        Advanced Conditions - Nesting
      • 5
        Types and Variables
      • 6
        Strings
      • 7
        Lists
      • 8
        For Loops
      • 9
        While Loops
      • 10
        continue, break, while...else
      • 11
        String and List methods
      • 12
        Nested Loops
      • 13
        List Comprehension
      • 14
        Tuples and Sets
      • 15
        dict
      • 16
        Functions
      • 17
        Functions 2
      • 18
        Lambda and higher-order functions
      • 19
        Files

  • Ant colony

    Ants are amazing. They are hard-working, very organized, and construct amazing habitats.
    Knowing that you’ve decided to start keeping an ant colony in an aquarium at home.
    notion image
    You’ve obtained n ants from a friend of yours and you’re wondering how many ants will there be in y years. Your friend tells you that the colony size increases by p percent every year. So, you decide to do the calculation for each of the next n years and see what the progress will look like.
     
    The program will receive 3 numbers. The number of ants your friend gave you n, the number of years you’re interested y, and the growth percentage p.
    Input
    Output
    150 8 10
    165 181.5 199.65 219.615 241.5765 265.73415 292.307565 321.5383215
     
    To check your solution you need to sign in
    Sign in to continue