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

  • Arithmetic progression

    In arithmetic progression, a starting number is given as , and each next item in the sequence is generated by adding a d integer to it:
    This way a long sequence of numbers is constructed.
     
    The company you are working for is wondering what the progress of the salaries for their employees will look like if they start from a certain starting salary and increase the salary by d every year?
    They are not interested in the numbers higher than a certain threshold, so they ask you to write a program that would print the yearly progress of the salaries up until the specified threshold.
    The first line in the input contains the initial salary. The next line is the year-on-year difference in salaries. The final line contains the upper bound, after which the company is not interested in the results anymore.
    The program should print the list of salaries the company is interested in.
    Input
    Output
    10000 1000 20000
    [10000, 11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000]
     
    To check your solution you need to sign in
    Sign in to continue