Prahallad Achar於 2019年2月15日星期五 UTC+8下午5時27分36秒寫道: > I get list object instead gen obj > > On Fri, 15 Feb 2019, 13:57 Chris Angelico <ros...@gmail.com wrote: > > > On Fri, Feb 15, 2019 at 6:57 PM Prahallad Achar <achar...@gmail.com> > > wrote: > > > > > > How about this > > > List1=[ 1,2,3,4] > > > Rever_gen = ( x*x for x in list1, reversed = True) > > > > > > Rever_gen gets generator object and iterating it now gets reverse order.. > > > > > > Am I correct here? Suggest me > > > > > > > How about reversed(list1) ? > > > > ChrisA > > -- > > https://mail.python.org/mailman/listinfo/python-list > > Rever_gen = ( x*x for x in reversed(list1))
-- https://mail.python.org/mailman/listinfo/python-list