Fix the Price Notice
Python
25 pts
Fix the Price Notice
A shop notice was typed badly: notice = " the price in asmara is 20 nakfa ".
- Create
result: remove the spaces at both ends, replace"20"with"25", and turn it into capitals. - Create
wordsby splittingresultinto a list of words. - Create
word_count— the number of words (uselen()).
Print result, then word_count. Expected output:
THE PRICE IN ASMARA IS 25 NAKFA 7
Checklist
- Keep
noticeunchanged and createresult: stripped, with25instead of20, and in capitals. - Create
wordsby splittingresultinto a list of words. - Create
word_count, the number of words. - Print
result, thenword_count.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
