Jun-10-2020, 10:17 AM
(This post was last modified: Jun-10-2020, 10:17 AM by mrityunjoy.)
Hi,
I have written the below piece of code, but output is showing list every time based on number of input. My expectation is to publish final list, how can I use return here
I have written the below piece of code, but output is showing list every time based on number of input. My expectation is to publish final list, how can I use return here
import math
def lists(*args):
lst = []
for i in args:
ele = math.sqrt(int(i))
lst.append("%.2f" % ele)
print(lst)
