VITyarthi Python Essentials Module 6 Challenging Task Solution

Challenging Task-Peer Assessment 1

What is the output of the following Python code block? Explain the logic of the given code. Explain the logic of the given program and write the output as well.

a=2 

b=12

 c=1 

d=a<b>c-1
d=2<12>1-1
d=2<12>0
d=1>0
print(d)

Solution

				
					a = 2
b = 12
c = 1
d = (a*c) - 1
if (d < b) and (d > 0):
  print(d)

				
			

If you find anything wrong in this Solution, feel free to reach us in the comment section.

Sharing Is Caring:

Leave a Comment