Fundamentals
Games
Fundamentals
def numberprint(x): final = '' for i in range(1,x+1): final += str(i) for i in range(x-1,0,-1): final += str(i) return int(final)
- def numberprint(x):
accending = list(range(1, x + 1))descending = list(range(x-1, 0, -1))newlist = accending + descendingstrings = [str(integer) for integer in newlist]a_string = "".join(strings)an_integer = int(a_string)return an_integer- final = ''
- for i in range(1,x+1):
- final += str(i)
- for i in range(x-1,0,-1):
- final += str(i)
- return int(final)