Given the following list N=[45,23,67,82,89,45,67,24] write the output of N[3:7]
Answers
Explanation:
A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2. Such a triple is commonly written (a, b, c), and the best known example is (3, 4, 5). The following list comprehension creates the Pythagorean triples:
[(x,y,z) for x in range(1,30) for y in range(x,30) for z in range(y,30) if x**2 + y**2 == z**2]
Output: :
[(3, 4, 5),
(5, 12, 13),
(6, 8, 10),
(7, 24, 25),
(8, 15, 17),
(9, 12, 15),
(10, 24, 26),
(12, 16, 20),
(15, 20, 25),
(20, 21, 29)]
Another example: Let A and B be two sets, the cross product (or Cartesian product) of A and B, written A×B, is the set of all pairs wherein the first element is a member of the set A and the second element is a member of the set B.
Mathematical definition: A×B = {(a, b) : a belongs to A, b belongs to B}. It's easy to be accomplished in Python:
Answer:
dont know bro....
Explanation:
sry, im in 10