+ 1

Can any one correct this code

# I don't understand why if condiation is not executing when i entered b=0 a=input("a valu ") b=input("b value ") if b == 0: print("plz enter a value other than zero") b=input("b value ") div = int(a)/int(b) print (div)

11th Jan 2017, 8:12 AM
Gopikrishna A
Gopikrishna A - avatar
3 RĂ©ponses
+ 6
sololearn can only have one input
11th Jan 2017, 8:20 AM
Ahri Fox
Ahri Fox - avatar
+ 1
Thank u @Kevin
11th Jan 2017, 8:25 AM
Gopikrishna A
Gopikrishna A - avatar
+ 1
input() provide the keyed in value as str. So need to cast to int using int()
11th Jan 2017, 9:15 AM
sharper_than_learning_curve