Write a function inflation that accepts a string txt, scans txt for strings of digits, and then concatenates each trailing digit with '000'. For example, if we had the string 'I have 2 dogs and 3...


Write a function inflation that accepts a string txt, scans txt for strings of digits, and then concatenates each trailing digit with '000'.<br>For example, if we had the string<br>'I have 2 dogs and 3 cats',<br>it should be transformed into<br>'I have 2000 dogs and 3000 cats'.<br>Hint: It might be worth searching for a string method that checks whether a given character is a digit.<br>Python<br>

Extracted text: Write a function inflation that accepts a string txt, scans txt for strings of digits, and then concatenates each trailing digit with '000'. For example, if we had the string 'I have 2 dogs and 3 cats', it should be transformed into 'I have 2000 dogs and 3000 cats'. Hint: It might be worth searching for a string method that checks whether a given character is a digit. Python

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here