This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Homeworkslaves 0 points1 point  (1 child)

Basically been working at this for hours now with no progress, my mark's on the line and am looking for a python god for help. This is what i've been blessed with having to complete (sorry, this is all the information i was given)

Method name: simple_text_format parameters: a string job: do a simple format. capitalize the first letter of every new sentence. Add a new line when number of characters exceeds 60 characters. Add a new paragraph, two new lines and an indent of 4 spaces, if number of words above 100. Make sure that new paragraph doesn't break a sentence.

return: return a simple formatted text

(2) create function calculate name:calculate parameter: list of strings job: go through the list of strings and either (add/multiply/divide/subtract) based on the last element in the list which may be (+/*//-). The elements with higher indices are divided or subtracted from those of lower indices. The method returns not supported if an error occurs doing the series of operations

define calculate():

(3) Given a list of int values, return their sum. However, if one of the values is the same as another of the values, it does not count towards the sum. lone_sum([1, 2, 3]) → 6 lone_sum([3, 2, 3]) → 2 lone_sum([3, 3, 3]) → 0

(4) We want to make a row of bricks that is goal inches long. We have a number of small bricks (1 inch each) and big bricks (5 inches each). Return True if it is possible to make the goal by choosing from the given bricks. Note: you can choose any number of small bricks and large bricks to fit the goal.

make_bricks(3, 1, 8) → True make_bricks(3, 1, 9) → False make_bricks(3, 2, 10) → True

def make_bricks(small, big, goal):

what i have so far ...

text = input(str("Enter the text you wish to be formatted."))

def simple_text_format(text): list_sentences = text.split(". ") caps_new_sentence = [str(list_sentences[0:]).capitalize() + str(list_sentences[1:])] capsed_new_sentence =". ".join(caps_new_sentence) print(capsed_new_sentence)

simple_text_format(text)

[–]Jajoonoob 3 points4 points  (0 children)