I put some classes(wow) in list a.
And I want to print the variable num of all elements of a without using for statement.
What should I do?
I want to(example):
[1,5,3,4,0] # Expected output
What I have tried:
import random as r
class wow():
def __init__(self):
self.num=r.randint(0,10)
a=[]
for x in range(5):
a.append(wow())
print((lambda x: x)(a).num)
for?