Range Function

Description:

Write a program to find the range of squares using List Input: 1. The Lower range 2 The upper range Output: The square of upper and lower number using list Test Case 1 Input (stdin) 2 5 Expected Output [(2, 4), (3, 9), (4, 16), (5, 25)] Test Case 2 Input (stdin) 5 10 Expected Output [(5, 25), (6, 36), (7, 49), (8, 64), (9, 81), (10, 100)]

Program :

  • a=int(input())
    b=int(input())
    x=[]
    for i in range(a,b+1):
        x.append((i,i*i))
    print(x)