I have a question regarding Python syntax.
When parsing a string and casting it to a float, I am running in to an issue.
I have the code
print "Please enter in x1 and y1 separated by a comma"
in1 = input()
sp1 = str(in1).split(',')
x1 = sp1[0]
If I enter in
5.4,3.2
and print out x1, I get
(5.4
This extra parenthesis makes it hard for me to convert into a floating point for further calculation. However, if I split based on a a decimal, such as
print "Please enter in x1 and y1 separated by a comma"
in1 = input()
sp1 = str(in1).split('.')
I am able to print x1 as
5
I do not get the parenthesis which is good, however I am not getting the correct number either.
Any help would be greatly appreciated, thank you