Python question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. In written text small numbers are often written out, e.g. you'd write 'I have two brothers and one sister', rather than 'I have 2 brothers and 1 sister'. In this problem you will implement a function convertSmall() that takes as input a text (i.e., string) s and returns the text s with small numbers (integers between 0 and 6) converted to their names. >>> convertSmall('I have 2 brothers and 1 sister') 'I have two brothers and one sister' >>> convertSmall('I have 8 brothers and 5 sisters') 'I have 8 brothers and five sisters'
Python question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks.
In written text small numbers are often written out, e.g. you'd write 'I have two
brothers and one sister', rather than 'I have 2 brothers and 1 sister'. In this problem you
will implement a function convertSmall() that takes as input a text (i.e., string) s and
returns the text s with small numbers (integers between 0 and 6) converted to their names.
>>> convertSmall('I have 2 brothers and 1 sister')
'I have two brothers and one sister'
>>> convertSmall('I have 8 brothers and 5 sisters')
'I have 8 brothers and five sisters'
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images