+ 1

Why does the code output 9?

try: num1=input(9) num2=input(3) print(float(num1)) except(SyntaxError, NameError, ValueError, ZeroDivisionError): print(float(num1/num2)) print(int(num1*num2)) except: from math import pi, sqrt as square_roo print(square_root(pi)) finally: from math import pi, sqrt as square_root print(square_root(pi))

23rd May 2019, 4:13 PM
Godswill Princewill
Godswill Princewill - avatar
2 odpowiedzi
+ 2
get rid of the prompts “9” and “3” in the input to prevent the beginning default message “93” appear in the console. num1 = input() num2 = input()
23rd May 2019, 4:40 PM
Choe
Choe - avatar
0
Thank you Choe
23rd May 2019, 5:05 PM
Godswill Princewill
Godswill Princewill - avatar