0

I need to know the execution order for the sixth line in the following code.

Using Python, Can anyone help explaining the execution order in interpreter of the sixth line please. Which statement or function or brackets executed first and so on.... I need to know the execution order. from math import sqrt ax= input('enter ax number please') ay= input ('enter ay number please') bx= input('enter bx number please') by = input ('enter by number please') Res= sqrt((int(ax)-int(bx))**2+(int(ay)-int(by))**2) https://code.sololearn.com/cY65OnpUVgD7/?ref=app

21st Jul 2019, 2:42 PM
Shehab Magdy
Shehab Magdy - avatar
3 ответов
+ 1
@~ swim ~ Correct me if I'm wrong. let's assume ax = 1, ay = 1, bx = 2, by = 4 so the steps to solve the line will be as following: Res= sqrt((int(ax)-int(bx))**2+(int(ay)-int(by))**2) Res= sqrt((int(1)-int(2))**2+(int(1)-int(4))**2) Res= sqrt((1-2)**2+(1-4)**2) Res= sqrt((-1)**2+(-3)**2) Res= sqrt(1+9) Res= sqrt(10) Res= 3.162277660168379
21st Jul 2019, 10:02 PM
Shehab Magdy
Shehab Magdy - avatar