about | help | code help+videos | done | prefs |
Modified From PY4E (chapter 6, ex 5): Write a function that takes a string as a parameter. The end of the string will contain a colon followed by a real (floating point) number. Return the floating point number. confidence('X-DSPAM:Confidence:0.8475') -> returns 0.8475 Use rfind and string slicing to extract the portion of the string after the colon character and then use the float function to convert the extracted string into a floating point number. confidence('X-DSPAM:Confidence:0.8475') → 0.8475 confidence('X-DSPAM:Confidence:0.12') → 0.12 confidence('X-DSPAM:Confidence:0.99') → 0.99 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100 Post-solution available
Copyright Nick Parlante 2017 - privacy