Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
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.
2 i2= False
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
0 · ·