From 0a2625f9df1d6b0485eaf9c72f2bfd1bd64b0112 Mon Sep 17 00:00:00 2001 From: JRMishra <64420423+JRMishra@users.noreply.github.com> Date: Thu, 25 Jun 2020 00:54:29 +0530 Subject: [PATCH] A better and more appropriate way to do this --- Python Data Structures/Chapter 6/Assignment 6.5.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Python Data Structures/Chapter 6/Assignment 6.5.py b/Python Data Structures/Chapter 6/Assignment 6.5.py index 22a00e6..fd9e2ba 100644 --- a/Python Data Structures/Chapter 6/Assignment 6.5.py +++ b/Python Data Structures/Chapter 6/Assignment 6.5.py @@ -10,3 +10,14 @@ b = float(a) print(b) text.find(":") + +""" + Created on 23rd June, 2020 + @author: J R Mishra +""" + +text = "X-DSPAM-Confidence: 0.8475"; +n=text.find(":") +a = text[n+1:] +b = a.strip() +print(float(b))