Untitled
plain_text
2 months ago
531 B
1
Indexable
Never
#ALGORITMA x1 = float (input('Masukkan Koordinat x1: ')) x2 = float (input('Masukkan Koordinat x2: ')) y1 = float (input('Masukkan Koordinat y1: ')) y2 = float (input10('Masukkan Koordinat y2: ')) if (x1 != x2 and y1 != y2): delta_x = x2 - x1 delta_y = y2 - y1 gradient = delta_y / delta_x print(F'Garis tersebut memiliki gradient {gradient}') elif (x1 != x2 and y1 == y2): print('Garis tersebut merupakan garis horizontal') elif (x1 == x2 and y1 != y2): print('Garis tersebut merupakan garis vertikal')