Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 388 Bytes

File metadata and controls

18 lines (15 loc) · 388 Bytes

What Did I Learn?

In this challenge I learned more about logic:

  1. I made a loop that counts how many 0s are at the end of the string
for i in range(len(num) - 1, -1, -1):
    if num[i] == '0':
        count += 1
    else:
        break
  1. I make a loop that goes until the length of the string - 0
for i in range(len(num) - count):
    ans += num[i]