DEV Community 👩‍💻👨‍💻

Discussion on: Find Factors of A number

Collapse
 
nciphalucas profile image
Vuyisile Lucas Ncipha Author • Edited on

YES, But a lot of people are new to python programming, if that was not the case I would have used lambda function to solve this.

   factors_of = lambda number: [k for k in range(1, number+1) if number%k==0]