help on half adder python

need help on this question:

Draw up the list of possible inputs for a half adder and the
outputs that you expect. Implement a half adder in a few lines of python, so that the
variables o1 and o2 are based on i1 and i2.

i1= True
2 i2= False
3 ............................
o1 =?
5 o2 =?

now i know the function should be something like this :h(i1, i2) =>o1, o2


i have come up with some coding but dont know the formula to put in and how to make all the coding work.


def half_adder(i1, i2):
o1 = # need formula here
o2 = # need formula here
return o1, o2
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories