+ 1

there is question with answer which not the best answer here

What is the output of this code? try: variable = 10 print (10 / 2) except ZeroDivisionError: print("Error") print("Finished") =============================== the options here https://prnt.sc/l8yqab =============================== I think the best answer is 5 Finished as in programming integer over integer give integer check that http://prntscr.com/l8yrd8

22nd Oct 2018, 11:40 AM
Ahmed Helal Ahmed
Ahmed Helal Ahmed - avatar
2 odpowiedzi
+ 3
Good Questioning. But the thing is that you are using python2. This course is python3. So has some differences. Plis check: https://code.sololearn.com/cRD9pyn5VZAY Edit: I not sayng python2 is bad is just different.
22nd Oct 2018, 12:23 PM
Anya
Anya - avatar
+ 3
Ahmed Helal Ahmed integer/integer=integer ,this is in python2 but when you divide integer by integer in python3 it will give you value in float.means value is very accurate.but if you want integer then you can simply convert float to integer with the help of built in function int(). e.g print(int(10/5))
22nd Oct 2018, 4:11 PM
Maninder $ingh
Maninder $ingh - avatar