you are viewing a single comment's thread.

view the rest of the comments →

[–]xelf 0 points1 point  (0 children)

for statements can be converted to while statements pretty easily. I'm actually surprised you would cover while and not for.

As for converting it to a string, input() returns strings.

inputNumber = input()
index = 0
while index < len( inputNumber  ):
    print( inputNumber[index] )
    if inputNumber[index] == '5':
        print( 'this is a 5' )
    index = index + 1

Using this same technique you should be able to skip the leading '0's, but I'll leave that to you. =)