Python - Methods and Behavior Definition
Which of the following is the correct syntax for a method that returns the sum of two numbers
a and b?a and b?return to send back the sum a + b.return a - b returns the difference. The version with print(a + b) prints but returns None. The version with just a + b lacks return. Only def add(a, b): return a + b correctly returns the sum.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions