Login using Social Account
     Continue with GoogleLogin using your credentials
In the previous exercise, we saw a couple of examples of startswith
. Let's do one more hands-on with startswith
. Here we will split a line and calculate an average based on the second element from the line based on certain conditions.
You can split a line using the split
function as follows:
splittedContent = stringToSplit.split(" ")
average_spam_confidence
which calculates the average spam confidence and returns itmbox-short.txt
which is located at /cxldata/datasets/project/mbox-short.txt
X-DSPAM-Confidence:
:
and take the string value which is spam confidenceNote: If your logic is correct then the correct spam confidence score should be 0.7507186
.
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...