in python Modify the following program (code) so that the user will error trap for only 1 and 0 as an input. If the user enters an input other than 1 or 0 display an error message and request the user...


in python


Modify the following program (code) so that the user will error trap for only 1 and 0 as an input.


If the user enters an input other than 1 or 0 display an error message and request the user enter that input again.  Do this for all inputs in the code.  Produce a flowchart.


def fun(a,b,c):
res1= a or b
res12= not res1
res2= b and c
resfinal=res12 or res2
return resfinal
if __name__=="__main__":
a=int(input("enter 1/0 as input: "))
b=int(input("enter 1/0 as input: "))
c=int(input("enter 1/0 as input: "))
output= fun(a,b,c)
print("final output is:",output)



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here