Nov-13-2019, 06:12 PM
Hello. Self-teaching and new to Python. I am trying to code a program where I ask a user for 2 points and attempt to calculate the distance. I keep running into errors when I try to take the inputted string, seperated by commas, and split them into the list.
For example, the question and input from the user is:
Any help?
For example, the question and input from the user is:
Quote:Enter x1 and y1 for Point 1: 1.9, -2.4This is the code I have so far:
Enter x2 and y2 for Point 2: 5, 6
import math import string from string import split [quote]x_input = input("Enter x1 and y1 for Point 1: ") y_input = input("Enter x2 and y2 for Point 2: ") x = split(x_input, ",") print (x[1])The error I keep getting is "AttributeError: 'tuple' object has no attribute 'split'".
Any help?