Python Program to calculate the square of a given number.

Madhan Umk
Dec 31, 2023

--

Square Formula x²


def calculate_square(number):
return number * number

numbers = [1,3,5,10]
for number in numbers:
print(f"The square of {number} is {calculate_square(number)}.")

#Result
The square of 1 is 1.
The square of 3 is 9.
The square of 5 is 25.
The square of 10 is 100.
Python Program to calculate the square of a given number

--

--

Madhan Umk
Madhan Umk

Written by Madhan Umk

90's Kid | Travel Blogger | #lyriclens | Photophile | Founder @lifeliker_in 🪄

No responses yet