Append To An Empty List Using A Single Line For-loop Python
Answer :
Write a proper comprehension, without append.
>>> [i for i in range(10)] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list(i for i in range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Write a proper comprehension, without append.
>>> [i for i in range(10)] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list(i for i in range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Comments
Post a Comment