I have been asked the following:
create inputs for a half-adder using python and the outputs i expect.
I was hoping someone could just have a look at this for me and see if i've got the right idea.
This will work from a copy and paste straight off the bat i should expect.
i1= True i2= False o1= "" o2= "" if i1 and i2== True: o1=True o2=True print "there is a sum and a carry" elif i1 or i2== True: o1=True o2=False print "there is a sum but no carry" elif i1 and i2== False: o1=False o2=False print "the is no sum and no carry" else: raw_input("Input 1 and 2 must be given a value of True or False") raw_input("")