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 bres12= not res1res2= b and cresfinal=res12 or res2return resfinalif __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)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here