+ 3

need help!

Hi! can someone please tell me why when this code is ran it returns "no output" . thnkz! https://code.sololearn.com/c1nAF8fOaxIg/#py

5th Jul 2018, 3:07 PM
MAAB
MAAB - avatar
7 Réponses
+ 16
The result is not printed. Try to use print function on the last statement.
5th Jul 2018, 3:15 PM
Igor Makarsky
Igor Makarsky - avatar
+ 3
output?? I mean print ()MAAB 😊👍
5th Jul 2018, 3:12 PM
Daljeet Singh
Daljeet Singh - avatar
+ 2
thank you both 李立威 and Igor Makarsky
5th Jul 2018, 3:18 PM
MAAB
MAAB - avatar
+ 2
looks like you got it working now
6th Jul 2018, 4:16 AM
Caleb Hale
Caleb Hale - avatar
+ 1
#Edit (1) add print at the last line # (2) modify the distance formula class Dist(): def __init__(self,a,b): self.a = a self.b = b def distance(self): x1,y1 = self.a x2,y2 = self.b return (((x2-x1)**2) + ((y1-y2)**2))**0.5 point1 = (2,2) point2 = (2,-4) calc = Dist(point1, point2) print(calc.distance())
5th Jul 2018, 3:16 PM
李立威
+ 1
5th Jul 2018, 3:22 PM
MAAB
MAAB - avatar
0
MAAB What??U know advanced things like class and return but u dont know print?What a ...just happen? lol
6th Jul 2018, 2:48 AM
I Am Arthur
I Am Arthur - avatar