Jump to content
Pardon our ads (a necessary update) ×

Leaderboard

Popular Content

Showing content with the highest reputation on 09/19/2025 in all areas

  1. The explanation there isn't... well, it's not an explanation. It's a description of what happens when the program runs. I guess you're supposed to reverse-engineer the algorithm from that? What you have there doesn't actually match the algorithm they're trying to get you to use. For example, you have the "output" argument - which isn't even actually necessary for this. You're also doing that "Nothing found" error message when the description is happy to stick with just empty strings. If you're looking for a more prescriptive version of what it is you're supposed to do, I'll rewrite it using your (better) sample input: Call find_caps with "nePaL" to get a value to print... The input string is not empty. The first letter "n" is not a capital letter, so return: Call find_caps with the rest of the input argument ("ePaL")... The input string is not empty. The first letter "e" is not a capital letter, so return: Call find_caps with the rest of the input argument ("PaL")... The input string is not empty. The first letter "P" is a capital letter, so return: A string consisting of that letter followed by: Call find_caps with the rest of the input argument ("aL")... The input string is not empty. The first letter "a" is not a capital letter, so return: Call find_caps with the rest of the input argument ("L")... The input string is not empty. The first letter "L" is a capital letter, so return: A string consisting of that letter followed by: Call find_caps with the rest of the input argument (""): The input string is empty so return "". Thus the return value will be "L" followed by "". Thus the return value will be "L". Thus the return value will be "P" followed by "L". Thus the return value will be "PL". Thus the return value will be "PL". Thus the value to print is "PL".
    1 point
This leaderboard is set to New York/GMT-05:00


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.