- 1
How to code "Find Numbers Divisible by Another Number" using lists inside funciton?
def myf(n,no,ele): list1 = [] for i in range(1,no): list1.append(ele) for i in list1: if (i%n == 0): print(i) n = int(input("enter a number: ")) no = int(input("enter total number of elements:")) print("enter numbers:") ele = int(input()) print("all numbers divisible by",n,"between 1-50 are:", myf(n,no,ele)) I am unable to run the above code, can you pls help me with the code and where I am going wrong?
1 Antwort
0
Also, put your code in Code Playground and edit your question with a link to it. And pls elaborate on "I am unable to run the above code" - what happens when you try? Be specific.