beginners help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guido van Brakel

    beginners help

    Hello

    I totally new to python and i'm doing a python course now. Maybe someone
    could help me a little bit here:

    I need to create this script.

    If i enter a center digit like 5 for example i need to create two
    vertical and horzitonal rows that looks like this. If i enter 6 it shows
    6 six starts. How can i do this, because i don't have any clue.

    *****
    * *
    * *
    * *
    *****

    Kind Regards,

    --
    Guido van Brakel
    --
  • Guilherme Polo

    #2
    Re: beginners help

    2008/2/7, Guido van Brakel <guidovb1@inval id.xs4all.nl>:
    Hello
    >
    I totally new to python and i'm doing a python course now. Maybe someone
    could help me a little bit here:
    >
    I need to create this script.
    >
    If i enter a center digit like 5 for example i need to create two
    vertical and horzitonal rows that looks like this. If i enter 6 it shows
    6 six starts. How can i do this, because i don't have any clue.
    >
    *****
    * *
    * *
    * *
    *****
    >
    This would totally ruin the purpose of your course. Did you try
    anything at all ?

    --
    -- Guilherme H. Polo Goncalves

    Comment

    • Diez B. Roggisch

      #3
      Re: beginners help

      Guido van Brakel wrote:
      Hello
      >
      I totally new to python and i'm doing a python course now. Maybe someone
      could help me a little bit here:
      >
      I need to create this script.
      >
      If i enter a center digit like 5 for example i need to create two
      vertical and horzitonal rows that looks like this. If i enter 6 it shows
      6 six starts. How can i do this, because i don't have any clue.
      >
      *****
      * *
      * *
      * *
      *****
      This list is not there to provide you with solutions to your homework. If
      you try and show us your efforts, or have otherwise concrete questions you
      certainly will get the help you want.

      Diez

      Comment

      • Matimus

        #4
        Re: beginners help

        On Feb 7, 7:53 am, Guido van Brakel <guidovb1@inval idwrote:
        Hello
        >
        I totally new to python and i'm doing a python course now. Maybe someone
        could help me a little bit here:
        >
        I need to create this script.
        >
        If i enter a center digit like 5 for example i need to create two
        vertical and horzitonal rows that looks like this. If i enter 6 it shows
        6 six starts. How can i do this, because i don't have any clue.
        >
        *****
        * *
        * *
        * *
        *****
        >
        Kind Regards,
        >
        --
        Guido van Brakel
        --
        If you turn this in you will be rewarded for your effort :)
        Code:
        side = input("How many stars on a side?:")
        if side == 5:
        print "*****"
        print "*   *"
        print "*   *"
        print "*   *"
        print "*****"
        elif side == 6:
        print "******"
        print "*    *"
        print "*    *"
        print "*    *"
        print "*    *"
        print "******"

        Comment

        • Steven D'Aprano

          #5
          Re: beginners help

          On Thu, 07 Feb 2008 13:53:48 +0100, Guido van Brakel wrote:
          Hello
          >
          I totally new to python and i'm doing a python course now. Maybe someone
          could help me a little bit here:
          >
          I need to create this script.
          >
          If i enter a center digit like 5 for example i need to create two
          vertical and horzitonal rows that looks like this. If i enter 6 it shows
          6 six starts. How can i do this, because i don't have any clue.
          >
          *****
          * *
          * *
          * *
          *****

          Start by writing some Python code that draws a horizontal line of stars.
          (Hint: "print '*' draws one star.)

          Now write some code that draws a column of stars.

          Now combine them to draw a square.

          Come back when you have some more specific questions.


          Regards,



          --
          Steven

          Comment

          Working...