0

How to return each element in list in a seperate new line

Without using any pre defined functions (generators,enumerated ,etc functions not acceptable)

6th Dec 2021, 1:49 PM
D.VANITHA
3 Answers
+ 2
You can use a for loop. Or unpack the list in the print statement and set the separator
6th Dec 2021, 2:06 PM
Lisa
Lisa - avatar
+ 2
Not optimal
6th Dec 2021, 2:18 PM
Amirreza
Amirreza - avatar
+ 2
"return each element in list in a separate new line" You probably meant to "print" them, rather than "return" them. These two refer to different concepts. "return" is only used with functions, so your idea "without using any function" makes no sense.
6th Dec 2021, 2:34 PM
Ipang