Functions in Python can be categorized as fruitful or void based on their return value.
def calculateSquare(num):
return num ** 2
def printSquare(num):
print("The square of", num, "is:", num ** 2)
number = 5
result1 = calculateSquare(number) # Fruitful function
print("Result from calculateSquare function:", result1)
printSquare(number) # Void function
Result from calculateSquare function: 25
The square of 5 is: 25
return
, suitable for computations where the result is needed.