id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs112fall2015 > sumprod
prev  |  next  |  chance

Write a function sumprod(a,b) that takes 2 integer values as parameters and returns their sum if they are not equal and their product if they are.


sumprod(3, 3) → 9
sumprod(2, 5) → 7
sumprod(0, 2) → 2

...Save, Compile, Run (ctrl-enter)

def sumprod(a,b):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy