Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. La Fée Verte (absinthe@qoto.org)'s status on Friday, 25-Oct-2019 03:36:50 UTC La Fée Verte La Fée Verte

    #toyprogrammingchallenge

    Okay, here's one. I just finished helping someone worth through this. So it's pretty fun.

    Write a program in Python, that can accept a paragraph string and and page
    width and return an array of left AND right justified strings. NOTE: No words
    should be broken, the beginning and end of the line should be characters).

    You should provide instructions on how to execute your program and provide a
    sample output.

    Example:

    Sample input:

    Paragraph = "This is a sample text but a complicated problem to be solved, so
    we are adding more text to see that it actually works."

    Page Width = 20

    Output should look like this:

    Array [1] = "This is a sample"
    Array [2] = "text but a"
    Array [3] = "complicated problem"
    Array [4] = "to be solved, so we"
    Array [5] = "are adding more text"
    Array [6] = "to see that it"
    Array [7] = "actually works.”

    In conversation Friday, 25-Oct-2019 03:36:50 UTC from qoto.org permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.
    • La Fée Verte (absinthe@qoto.org)'s status on Friday, 25-Oct-2019 11:06:33 UTC La Fée Verte La Fée Verte
      in reply to

      I am not happy with the pythonicallity of this, but it solves the problem...

      https://git.qoto.org/Absinthe/justify

      In conversation Friday, 25-Oct-2019 11:06:33 UTC permalink
      🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.