Question:
Write a method that can calculate the square value of the number
Hints:
Using the ** operator
Solution:
def square(num):
return num ** 2
print square(2)
print square(3)
Code language: Python (python)
Write a method that can calculate the square value of the number
Using the ** operator
def square(num):
return num ** 2
print square(2)
print square(3)
Code language: Python (python)