0

How can I stop the loop

try: num=input("miles or Kilometers") def Conversion(num): if num=="miles": miles=int(input("how many miles")) if num==0: print("thanks for using the converter") else: Kilometers=miles*1.609344 print(Kilometers) print(Conversion(num)) elif num=="Kilometers": Kilometers=int(input("how many Kilometers")) if num==0: print("thanks for using the converter") else: miles=Kilometers/1.609344 print(miles) print(Conversion(num)) Conversion(num) except: print("thanks for using the converter")

27th Aug 2020, 8:38 AM
Jesupemi Abere
Jesupemi Abere - avatar
3 Respuestas
+ 1
Is this the complete code? I can't see a loop anywhere in that code ... I see try ... except and if ... elif ... else but no loop. Where is the loop? I recommend you to share your code link instead, you won't have to worry about character limits by sharing code link, it's safer and easier to analyse. https://www.sololearn.com/post/75089/?ref=app
27th Aug 2020, 8:42 AM
Ipang
+ 1
1. for i in range(5): print(i) break 2. x=3 while x<5: print("hello") x=6
27th Aug 2020, 9:27 AM
Shadoff
Shadoff - avatar
+ 1
When you run the code It always asks the same input over and over
27th Aug 2020, 10:14 AM
Jesupemi Abere
Jesupemi Abere - avatar