How can I convert hamming number code in a while or for loop python

前端 未结 0 1234
难免孤独
难免孤独 2020-11-30 16:31
def is_hamming_numbers(x):
if x == 1:
    return 1
if x % 2 == 0:
    return is_hamming_numbers(x/2)
if x % 3 == 0:
    return is_hamming_numbers(x/3)
if x % 5 == 0:         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题