+ 1
Help me please
Hello guys How create nested loop table , for each number from 1 toĀ num, the function should print out a list containing the first 10 multiples of theĀ number. for example input : 5 out: [1,2,3,4,5,6,7,8,9,10] [2,4,6,8,10,12,14,16,18,20] ... ... ... [5,10,15,20,25,30,35,40,45,50] for i in range (1, 11): for j in range (1, 11) if num % 10 == 0: lst.append(j*i) print(lst) My output [] , tell me please how is work ?
5 Answers
+ 3
Aid you can just run a loop to multiply all the numbers in the list, then print the list, and set the list back to [1,2,3,4,5,6,7,8,9,10]!
I made a code about this:
https://code.sololearn.com/cDi6HIaF0Rac/?ref=app
Hope it works! Happy programming :)
+ 3
I am assuming num is 5 and so 5%10 always outputs 5 , therefore you get an empty list.
+ 2
Abhay thanks š
0
TheCoder thanks š