Ad
Fundamentals
Code
Diff
  • def numberprint(x):
        f = ''
        for i in range(x):
            f += str(i)
        for i in range(x,0,-1):
            f += str(i)
        return int(f)
    • def numberprint(x):
    • nor = 0
    • final = ''
    • while nor < x:
    • nor += 1
    • final += str(nor)
    • while nor > 1:
    • nor -= 1
    • final += str(nor)
    • return int(final)
    • f = ''
    • for i in range(x):
    • f += str(i)
    • for i in range(x,0,-1):
    • f += str(i)
    • return int(f)
Code
Diff
  • def find_max(arr):
        return max(arr)
    • def find_max(arr):
    • return 0
    • return max(arr)
Code
Diff
  • def converter(number):
        return ["zero","one","two","free","four","five","six","seven","eight","nine"][number]
    • def converter(number):
    • if number == 0:
    • return "zero"
    • elif number == 5:
    • return "five"
    • return number
    • return ["zero","one","two","free","four","five","six","seven","eight","nine"][number]