Question: Ibrary > ICS 1 0 4 : Introduction to Programming Using Python and C home > More while examples zyBooks catalog Help / FAO You

Ibrary > ICS 104: Introduction to Programming Using Python and C home >
More while examples
zyBooks catalog
Help/FAO
You are using an unsupported browser. Please see our systems requirements page for a list of supported browsers. x
Run
Feedback?
CHALLENGE
ACTIVITY
4.3.4: Advanced while loop examples.
Start
Strings item_of_interest and input_item are read from input. Integer expected_count is initialized with 1. Write a while loop that iterates until inputitem is equal to 'Done'. In each iteration of the loop
Increment expected_count if input_item is equal to item_of_interest.
Read string input_item from input
Click here for example
Note: Assume that input has at least two strings
1 item_of_interest = input ()
2 input_item = input ()
4 expected_count =1
6 I''' Your code goes here ''.
8 print(f'{item_of_interest} occurs {expected_count } time(s).')
1
2
3
Check
Next level
 Ibrary > ICS 104: Introduction to Programming Using Python and C

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!