Question: Your program will take a string as an input and using slice and find function, to extract a string after a colon. Then, convert it

Your program will take a string as an input and using slice and find function, to extract a string after a colon. Then, convert it to floating point number and add 2.0 to it. Print output displaying the number as following example shows:

Enter a string with a colon and a number after it.: This is a sample string with number: 1.542

Extracted a number from given string and added 2.0 to it: 3.542

OUTPUT:

- The bold text is the user's input.( Red, italicized portion is user input)

*************************************************************************************

Enter a string with a colon and a number after it: This is a test data with a number: 3.452

Extracted a number from given string and added 2.0 to it: 5.452

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!