CJCoding With Joseph
15free / daySign inCreate account

Starts With A Prefix

Read a word and a prefix and print exactly Yes when the word begins with the prefix and No otherwise, without any string method: slice the word from 0 to len(prefix) and compare that slice with the prefix using ==. Input: two lines, the word then the prefix, no prompts.

Expected Output:

Yes

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
StringsSlicing
📥 Auto-Input:
unhappy\nun\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.