text: def mygenerator():
      yield 1
      yield 2
      yield 3
  
  g = mygenerator()
  
  # print(g)
  
  # for i in g:
  #     print(i)
  
  # value = next(g)
  # print(value)
  
  # value = next(g)
  # print(value)
  
  # value = next(g)
  # print(value)
  
  # print(sum(g))
  
  def mygenerator():
      yield 4
      yield 2
      yield 3
  g = mygenerator()
  
  print(sorted(g))
  
  
  def countdown(num):
      print('Starting')
      while num >0:
          yield num
          num -= 1
  cd =countdown(4)
  
  value = next(cd)
  print(value)
  value = next(cd)
  print(value)
  value = next(cd)
  print(value)
  
  import sys
  def firtn(n):
      nums = []
      num = 0
      while num < n:
          nums.append(num)
          num += 1
      return nums
  def firstn_generator(n):
      num = 0
      while num < n:
          yield num
          num += 1
  # print(sys.getsizeof(firtn(10000000)))
  # print(sys.getsizeof(firstn_generator(10000000)))
  
  def fibnacci(limit):
      a,b = 0,1
      while a < limit:
          yield a
          a,b = b,a+b
  fib = fibnacci(30)
  for i in fib:
      print(i)
  
  mygenerator = (i for i in range(10000) if i % 2 ==0)
  for i in mygenerator:
      print(i)
  
  mylist = [i for i in range(10000) if i % 2 ==0]
  for i in mylist:
      print(i)
  
  print(sys.getsizeof(mygenerator))
  print(sys.getsizeof(mylist))