Python Forum
list call problem in generator function using iteration and recursive calls
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list call problem in generator function using iteration and recursive calls
#1
[inline]I want to convert any long integer number from 12576 to [6, 2], all the following snippets give me [[6, 2]] I want to remove the 2nd square bracket

gen = evens(1234)
print(next(gen)) # gives ==> [4, 2]


but


list(evens(1234) # gives ==> [[4, 2]]



is there is another method to eliminate the second square brackets using the same generators
thanks in advance[/inline]
Reply


Messages In This Thread
list call problem in generator function using iteration and recursive calls - by postta - Oct-24-2020, 08:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in using generator akbarza 2 534 Nov-07-2023, 08:40 AM
Last Post: perfringo
  for loops break when I call the list I'm looping through Radical 4 889 Sep-18-2023, 07:52 AM
Last Post: buran
  with open context inside of a recursive function billykid999 1 579 May-23-2023, 02:37 AM
Last Post: deanhystad
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 795 May-02-2023, 08:40 AM
Last Post: Gribouillis
  Problem with "Number List" problem on HackerRank Pnerd 5 2,094 Apr-12-2022, 12:25 AM
Last Post: Pnerd
  List Iteration Help javeeva 2 1,192 Feb-07-2022, 11:23 PM
Last Post: snippsat
  asyncio calls within sync function ( Websocket on_open) orion67 0 1,410 Jan-16-2022, 11:00 AM
Last Post: orion67
  Problem With Database Calls and Load Timbo03 1 2,126 Nov-21-2021, 10:48 AM
Last Post: Timbo03
  Tuple generator, and function/class syntax quazirfan 3 3,882 Aug-10-2021, 09:32 AM
Last Post: buran
  Why recursive function consumes more of processing time than loops? M83Linux 9 4,249 May-20-2021, 01:52 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020