Jun-30-2021, 02:22 AM
import math A = list(map(int, input())) B = list(map(int, input())) #C = list(map(int, input())) if A,B < len(3): print(D_1) else: print(D_2) D_1 = math.sqrt( (B[0]-A[0])**2 + (B[1]-A[1])**2 + (B[2]-A[2])**2 ) D_2 = math.sqrt( (B[0]-A[0])**2 + (B[1]-A[1])**2 )i tried to create a code that will calculate the distance between two points and it succeed but when i try to do the conditional part to make two option if the vector has two values x and y it will print D_2 and if it has x y z it will print D_1 but it shows a lot of mistakes i dont know how to state the a condition which will check the amount of values in the lists and print one of two solution according the amount of values there 3 or less???
Attached Files