t= int(input())
i=0
while i <= t:
A,B,A1,B1,A2,B2 = map(int, input().split())
max_ab = max(A,B)
min_ab = min(A,B)
max_a1b1 = max(A1,B1)
min_a1b1 = min(A1,B1)
max_a2b2 = max(A2,B2)
min_a2b2 = min(A2,B2)
if(max_ab == max_a1b1 and min_ab == min_a1b1):
print('1')
elif(max_ab == max_a2b2 and min_ab == min_a2b2):
print('2')
else:
print('0')
i += 1
return 0
T = int(input())
for i in range(T):
l = list(map(int, input().split()))
a = set(l)
if (len(a) == 4):
print(2)
elif (len(a) == 3):
print(2)
elif (len(a) == 2):
l.sort()
b = l[0]
if(l.count(b) == 2):
print(2)
else:
print(1)
else:
print(0)
3 1 4 3 2 2 4 5 5 5 1 2 2 2 2 0
import datetime
d1 = datetime.datetime(2022, 5, 3)
d2 = datetime.datetime(2019, 6, 1)
print("d1 is greater than d2 : ", d1 > d2)
print("d1 is less than d2 : ", d1 < d2)
print("d1 is not equal to d2 : ", d1 != d2)
d1 is greater than d2 : True d1 is less than d2 : False d1 is not equal to d2 : True
from decimal import Decimal
class Distance:
def GetDistance(self):
self.__m=int(input("Enter M: "))
self.__km =int(input("Enter KM: "))
def PutDistance(self):
print(self.__km,self.__m)
def __add__(self, T):
R=Distance()
R.__m=self.__m+T.__m
R.__km = self.__km + T.__km
R.__km=R.__km+(R.__m//1000)
R.__m=R.__m%1000
return R
def __sub__(self, T):
R = Distance()
R.__m = self.__m - T.__m
R.__km = self.__km - T.__km
R.__km = R.__km + (R.__m//1000)
R.__m = R.__m % 1000
return R
def __mult__(self, T):
R = Distance()
R.__m = self.__m * T.__m
R.__km = self.__km * T.__km
R.__km = R.__km + (R.__m//1000)
R.__m = R.__m % 1000
return R
def __div__(self, T):
R = Distance()
R.__m = self.__m / T.__m
R.__km = self.__km / T.__km
R.__km = R.__km + (R.__m//1000)
R.__m = R.__m % 1000
return R
D1= Distance()
D2= Distance()
print("Enter first distance")
D1.GetDistance()
print("Enter second distance")
D2.GetDistance()
D3=D1+D2
print("The sum of both distance is" )
D3.PutDistance()
D4 = D1-D2
print("The sub of both distance is")
D4.PutDistance()
D5 = D1*D2
print("The mult of both distance is")
D5.PutDistance()
D6 = Decimal(D1/D2)
print("The div of both distance is" )
D6.PutDistance()
Enter first distance Enter M: 400 Enter KM: 5 Enter second distance Enter M: 200 Enter KM: 3 The sum of both distance is 8 600 The sub of both distance is 2 200
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Input In [10], in <cell line: 62>() 59 print("The sub of both distance is") 60 D4.PutDistance() ---> 62 D5 = D1*D2 63 print("The mult of both distance is") 64 D5.PutDistance() TypeError: unsupported operand type(s) for *: 'Distance' and 'Distance'
class Box:
l=0
b=0
d=0
def f1(self):
print("length =" ,self.l)
print("breadth =" ,self.b)
print("depth =" ,self.d)
class WeightBox(Box):
weight=0
def f2(self):
print("weight =" ,self.weight)
class ColorWeightBox(WeightBox):
color=0
def f3(self):
print("color =" ,self.color)
Box = ColorWeightBox()
Box.color = 'Green'
Box.f3()
Box.weight = 30
Box.f2()
Box.l = 10
Box.b = 20
Box.d = 10
Box.f1()
color = Green weight = 30 length = 10 breadth = 20 depth = 10