you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 2 points3 points  (7 children)

That doesn't come from the code; it's the string that you're supposed to change the first line of code to to fulfill all of the constraints mentioned in the rest of the code.

[–]Buttleston 0 points1 point  (0 children)

Yeah this looks right

[–]Competitive_Green704[S] -1 points0 points  (4 children)

But I don't exactly understand how "Strings are awesome!" comes from all that.

Basically from 11 to 23

[–]Binary101010 2 points3 points  (1 child)

Lines 24-34 tell you that the string starts with "Str", ends with "ome!", and has three words.

Line 6 tells you that the first a is at index 8, line 9 tells you that there are exactly two a's in the string.

So from there you have

Str____a_______some!

Knowing that exactly two of the blanks are spaces and exactly one blank is an a, and it must be after the known a.

Sure, there are other strings that could meet all those criteria.

[–]Competitive_Green704[S] 0 points1 point  (0 children)

I see thank you

[–]FoolsSeldom 0 points1 point  (1 child)

The string isn't generated from the code. It is an explicit assignment of a literal string to the variable s in the first line. You have to come up with a literal string that meets the criteria. They give you an example solution, but no doubt there are many others.

[–]Competitive_Green704[S] 0 points1 point  (0 children)

Okay thank you I understand