+ 1

def add_numbers(x, y): total = x + y return total print("This won't be printed") def gsc(): z=(add_numbers(4, 5)

why is this code not working??

4th Feb 2018, 3:44 PM
Gaurav Singh
Gaurav Singh - avatar
2 Respostas
+ 2
thank you very much...
4th Feb 2018, 4:03 PM
Gaurav Singh
Gaurav Singh - avatar
0
you have a function called gsc() that does nothing except call another function, but you aren't calling gsc() so it doesn't call the add function.. cut that part all together and simplify simply do this instead.. def add_numbers(x,y): return x+y print(add_numbers(4,5)) or if you would prefer.. z=add_numbers(4,5)
4th Feb 2018, 3:47 PM
LordHill
LordHill - avatar