AP Computer Science Principles Flashcards: Strings

Study Strings in AP Computer Science Principles with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.

QUESTION

What method finds a substring's first occurrence in Python?

Tap card or press Space to flip

ANSWER

find(). Locates initial position of substring occurrence.

1 / 37

AP Computer Science Principles: Algorithms and Programming

All flashcards

37 cards

What this deck covers

This deck focuses on Strings, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.

How to use these flashcards

Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.

Practice questions

1 of 19Practice questions for this set
A program is intended to create an acronym from a three-word phrase stored in the string variables w1, w2, and w3. For example, if w1 is "Computer", w2 is "Science", and w3 is "Principles", the acronym should be "CSP". Assuming a procedure FIRSTLETTER(str)FIRST_LETTER(str) returns the first character of a string, which expression creates the correct acronym?
Choose an answer

Keep your progress across every deck

Free account · cards you mark are saved to it