DEV Community

Discussion on: Day 4 of 100DaysOfCode: Code to Calculate HCF Of Two Numbers

Collapse
 
otumianempire profile image
Michael Otu • Edited

Your program returns the Common Factors of two numbers. A list actually..

enter the number: 135
enter the number: 45
[1, 3, 5, 9, 15, 45]  # the common factors

enter the number: 19
enter the number: 0
[] 
Enter fullscreen mode Exit fullscreen mode

0 is expected.

it should return a number. Use print(f"{max(cf)}")

Collapse
 
iamdurga profile image
Durga Pokharel

Thanks for the suggestion.🙂