Table of Contents
ToggleChallenging Task-Peer Assessment 1
On what input of a and b this program will display “I win the game”? Find the value of a and b.
if (a & b >= 1) | (a^b <=1) :
print(“I win the game”)
else:
print(“I lose the game”)
Solution
a = 3
b = 5
if (a & b >= 1) | (a^b<=1) :
print("I win the game")
else:
print("I lose the game")
Challenging Task-Peer Assessment 2
On what input of a and b this program will display “I win the game”? Find the value of a and b. And explain the logic of this program (Note: The order of evaluation and precedence of expression evaluation) .
if (a & b >= 1) | (a^b <=1) :
print(“I win the game”)
else:
print(“I lose the game”)
Solution
a = 3
b = 2
if (a & b >= 1) | (a^b<=1) :
print("I win the game")
else:
print("I lose the game")
If you find anything wrong in this Solution, feel free to reach us in the comment section.