Добавить
Уведомления

Given a tuple pair ((2,5),(4,2),(9,8),(12,8)),count the number of pair (a,b) such that a and b are

Q 8 type C || tuples || Sumita arora || class 11|| computer science || Q 8 type c chapter tuples sumita arora class 11|| Q. Given a tuple pair ((2,5),(4,2),(9,8),(12,8)),count the number of pair (a,b) such that a and b are even . Website Link :- https://www.pathwalla.com/2019/06/class-11-computer-science-sumita-arora_52.html Answer :- tup = ((2,5),(4,2),(9,8),(12,8)) count = 0 for i in range (len(tup)): if tup [i][0] % 2 == 0 and tup[i][1] % 2 == 0: count += 1 print("The number of pair (a,b) such that a and b are even = ",count) Output :- The number of pair (a,b) such that a and b are even = 2

12+
15 просмотров
2 года назад
3 декабря 2023 г.
12+
15 просмотров
2 года назад
3 декабря 2023 г.

Q 8 type C || tuples || Sumita arora || class 11|| computer science || Q 8 type c chapter tuples sumita arora class 11|| Q. Given a tuple pair ((2,5),(4,2),(9,8),(12,8)),count the number of pair (a,b) such that a and b are even . Website Link :- https://www.pathwalla.com/2019/06/class-11-computer-science-sumita-arora_52.html Answer :- tup = ((2,5),(4,2),(9,8),(12,8)) count = 0 for i in range (len(tup)): if tup [i][0] % 2 == 0 and tup[i][1] % 2 == 0: count += 1 print("The number of pair (a,b) such that a and b are even = ",count) Output :- The number of pair (a,b) such that a and b are even = 2

, чтобы оставлять комментарии