omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. HatePastaCode74

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    HatePastaCode74

    @HatePastaCode74

    0
    Reputation
    494
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    HatePastaCode74 Unfollow Follow

    Latest posts made by HatePastaCode74

    • Head First Python problem

      I just started learning Python with Pythonista and the book 'Head First Python'

      There is an exercise which I do not understand. I create a list variable: eg
      movies = [ 'and', 'bin', 'can','den']
      and then the code snippet:
      for each_item in movies: print(each_item)
      and
      bin
      can
      den

      Which as expected prints each string on a new line. When I put this code into this function:

      def print_list(My_list):
      for an_item in My_list:
      if isinstance(My_list,list):
      print_list(an_item)
      else:
      print(an_item)
      print_list(movies)

      the list entries print out each character of each string on a new line. What is going on here?
      a
      n
      d
      b
      i
      n
      .
      .
      .

      posted in Pythonista
      HatePastaCode74
      HatePastaCode74
    • RE: Head First Python problem

      Thanks,
      that works.

      posted in Pythonista
      HatePastaCode74
      HatePastaCode74