Question: '''make a function''' def getSym(x): '''return T if True''' if x: return 'T' else: '''else return False''' return 'F' values = [True, False] print('p','q','and','or',' (if
'''make a function''' def getSym(x): '''return T if True''' if x: return 'T' else: '''else return False''' return 'F'
values = [True, False]
print('p','q','and','or',' (if p, then q',' (p if and only if q)') '''take a loop''' for p in values: '''take inner loop''' for q in values: '''call a function''' print(getSym(p), ' ',getSym(q),' ', getSym(p and q),' ', getSym(p or q),' ', getSym(q or (not p)),' ',getSym((p or (not q)) and (q or (not p))),sep="")
Explain every step and function of this code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
