exam questions

Exam 98-381 All Questions

View all questions & answers for the 98-381 exam

Exam 98-381 topic 1 question 13 discussion

Actual exam question from Microsoft's 98-381
Question #: 13
Topic #: 1
[All 98-381 Questions]

HOTSPOT -
The ABC company needs a way to find the count of particular letters in their publications to ensure that there is a good balance. It seems that there have been complaints about overuse of the letter e. You need to create a function to meet the requirements.
How should you complete this code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.

Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://www.w3resource.com/python/python-for-loop.php

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
mukhamad_a
2 years, 12 months ago
correct
upvoted 2 times
...
rikku33
3 years, 9 months ago
for 2nd: word in letter or letter in word both correct
upvoted 1 times
...
sadako11
4 years, 6 months ago
Adding extra for loop to count the total number of "letter" def count_letter(letter, word_list): for word in word_list: for ii in word: if ii == letter: count+=1 return count
upvoted 2 times
...
JeffJupiter
5 years ago
I don't see count being incremented by one in letter is found. Return count should be after the for loop is completed
upvoted 2 times
FuzzyDunlop
4 years, 11 months ago
count is incremented in the if statement. I agree that the return statement should be outside the for loop.
upvoted 3 times
...
gargaditya
4 years, 8 months ago
Yes,there could be 2 letters as well in the word, the code needs another for loop: for letter in word: count+=1
upvoted 1 times
gargaditya
4 years, 8 months ago
(meant to replace the 'if' with 'for')
upvoted 3 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...