fork download
  1. def four(n):
  2. if n - 4 != 0:
  3. if n % 10 == 0:
  4. four(n//10)
  5. elif n % 10 == 4:
  6. four(n//10)
  7. else:
  8. four(n * 2)
  9. print(n, end=" ")
  10.  
  11. def main():
  12. four(1234)
  13. main()
Success #stdin #stdout 0.02s 9016KB
stdin
Standard input is empty
stdout
4 2 24 12 124 62 624 312 156 78 784 392 196 98 984 492 246 123 1234