Exam Foundations-of-Programming-Python Topic 1 Question 40 Discussion

Actual exam question for WGU's Foundations-of-Programming-Python exam
Question #: 40
Topic #: 1
Which index position is returned when the string method .find( ' python ' ) is applied to the string ' learning python programming ' ?

Suggested Answer: B Vote an answer

The .find() method returns the lowest index where the searched substring is found.
Example:
" learning python programming " .find( " python " )
Output:
9
Indexing starts at 0 in Python. In the string ' learning python programming ' , the word ' python ' begins at index 9. Python's built-in types documentation describes str.find() as returning the lowest index where the substring is found.
Therefore, the correct answer isB. 9.

by Marina at Aug 14, 2026, 08:03 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10