I am new to python stuck with the issue of not getting the list after appending using the *args to fetch every element.
def has_33(*args):
m=[]
for i in args:
m = m.append(i)
print(m)
has_33([1,3,3])
output
None
You can do something like this:
def has_33(*args):
m=list(args)
print(m)
has_33([1,3,3])
And if you don't need the list you can do this:
def has_33(*args):
m=list(args)
n = []
for l in m:
for elem in l:
n.append(elem)
print(n)
has_33([1,3,3])
Remove m=m.append(i)
and write like this m.append(i)
This works.