Question: Validating isExponentialFloat ( ) using only iterations, conditionals and string handling. * * * * * * * * I ' M WRITING IN CAPITALS

Validating isExponentialFloat() using only iterations, conditionals and string handling.
*****
***
I'M WRITING IN CAPITALS SO YOU READ THIS PROPERLY. THIS IS STILL SAYING THAT "-12.33-e3"(NOTE 2 MINUS SYMBOLS) IS NOT AN EXPONENTIAL FLOAT... BUT "-12.33-e3"(NOTE 2 MINUS SYMBOLS) IS AN EXPONENTIAL FLOAT. THE PROGRAM IS STILL WRONG.
*****
This works well but when I enter in the list "-12.33e-3"(a minus number with a minus exponential) it says "This number is not an Exponential Float" BUT IT IS. The minus symbol was simply removed from the last solution which does not make the code right. I have added "-12.33e-3","12.33e-3" to the test solutions - "This number is an Exponential Float". both need to be recognised as Please fix this.
*****
This is a re-do of a previously asked answer except that this needs to be answered using only iterations, conditionals and string handling. i.e. if, elif and else (not 'pattern' and 'return')
How do I write a python function isExponentialFloat() that returns true if a number is in correct exponential format i.e.2.4e3,-3.21e2 or -12.33e-3 and returns false for any other format.
Need to use both of these in determining if a =...
1.
isDigPeriod() to determine if number has digits and periods only... followed by
a = isInt("$3")
resulting in a getting a false
2.
isInt() to determine if number is an intereg with (can include negative, zero or poositive)
a = isInt("-58")
resulting in a getting a true
FOLLOWED BY...
# Test the functions
inputs =["2.4e3","3.21e2","-12.33e-3","12.33e-3","$3","-58","3.7e5"]
If true for both prints "This number is an ExponentialFloat" or if either or both are false prints "This number is not an ExponentialFloat".
# Good output style
for num in inputs:
if isExponentialFloat(num):
print(f"{num}: This number is an ExponentialFloat")
else:
print(f"{num}: This number is not an ExponentialFloat")

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 Programming Questions!