I'm brand new to python 3 & my google searches have been unproductive. Is there a way to write this:
for x in range(10):
print(x)
as this:
print(x) for x in range(10)
I do not want to return a list as the arr = [x for x in X]
list comprehension syntax does.
EDIT: I'm not actually in that specific case involving print()
, I'm interested in a generic pythonic syntactical construction for
method(element) for element in list