Computer Science, asked by nagaratnaksgr2000, 9 months ago

triples = [ (x,y,z) for x in range(2,4) for y in range(2,5) for z in range(5,7) if 2*x*y > 3*z ]

Answers

Answered by sjena30400
2

Answer:

Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Tap on a clip to paste it in the text box.Welcome to Gboard clipboard, any text that you copy will be saved here.Use the edit icon to pin, add or delete clips.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Tap on a clip to paste it in the text box.Welcome to Gboard clipboard, any text that you copy will be saved here.Use the edit icon to pin, add or delete clips.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Use the edit icon to pin, add or delete clips.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Use the edit icon to pin, add or delete clips.Welcome to Gboard clipboard, any text that you copy will be saved here.Tap on a clip to paste it in the text box.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Welcome to Gboard clipboard, any text that you copy will be saved here.Tap on a clip to paste it in the text box.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.

Answered by AskewTronics
0

[(2, 4, 5), (3, 3, 5), (3, 4, 5), (3, 4, 6)]  is the value of triples variable in the above question code.

Explanation:

  • If there is not a if condition, then the triple variable holds the "[(2, 2, 5), (2, 2, 6), (2, 3, 5), (2, 3, 6), (2, 4, 5), (2, 4, 6), (3, 2, 5), (3, 2, 6), (3, 3, 5), (3, 3, 6), (3, 4, 5), (3, 4, 6)]" value which is like (x1,y1,z1),(x1,y1,z2) and so on for every x,y,z value, where x1,y1and z1 is the subset of the three defined loop.
  • But the if condition will states that value in which 2*x*y > 3*z for every x,y,z value. The x,y,z value is listed from the three-loop which uses the x,y,z variable.
  • So when any user calculates the above set like "2*x*y > 3*z", then only "[(2, 4, 5), (3, 3, 5), (3, 4, 5), (3, 4, 6)] " will be the output which is the answer.

Learn More :

  • Python : https://brainly.in/question/14689905
Similar questions