How to print this sequence using python loops | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

How to print this sequence using python loops

2*4= 8 2 * 6 = 12 4 * 2 = 8 4 * 6 = 24 6*2= 12 6*4 = 24

10th Apr 2023, 6:00 AM
Ayush Pandit
1 Réponse
+ 6
You can solve it with two nested loops. Each loop would have a variable (a and b) that takes the numbers 2, 4 and 6. You can express it with range(2,7,2) When a and b are not equal, do the printing of their multiplication. Otherwise do nothing.
10th Apr 2023, 6:15 AM
Tibor Santa
Tibor Santa - avatar