Answer to Question #256479 in Python for rasi

Question #256479

20) Given that a man can jump X meters and after every jump, he comes back 1 meter as it is a slope model and given N poles to cross. Then print how many jumps are needed.

 


1
Expert's answer
2021-10-31T12:01:38-0400
x = int(input('can jmp to:'))
n = int(intpu('distance:'))
i = 0
while i * ( x - 1 ) + x < n:
  i = i + 1
print(i + 1) 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS