1. Engineering
  2. Computer Science
  3. in python please your program will take a string as...

Question: in python please your program will take a string as...

Question details

IN PYTHON PLEASE.

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 and print output displaying following with input provided as follows:

=================================================

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

=================================================

Ask user for an input string and using slice and find function, separate a string after the colon. Then convert it to a floating point number so that you can add 2.0 to it.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution