LAB: Output range with increment of 5

LAB: Output range with increment of 5

Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer.

1 Answers

  • Sharie Latson
    18 days ago
    first = int(input())
    second = int(input())
    if first > second:
        print("Second integer can't be less than the first.")
    else:
        while first <= second:
            print(first, end=' ')
            first += 5
        print()
    LAB Output range with increment of 5

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Questions