Skip to content

Commit

Permalink
Adicionado resolução desafio-03 (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaBatata101 authored and marcopaganini committed Jan 17, 2019
1 parent d7e2a2f commit 0c5ef4e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions desafio-03/LaBatata101/python/desafio03.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Calculate palindrome numbers between two numbers"""


def palindromo(start, end):
"""Returns a list of palindrome numbers between start and end"""
return [i for i in range(start, end + 1) if str(i) == str(i)[::-1]]


def main():
"""Main function"""
start = int(input('Entre o numero inicial: '))
end = int(input('Entre o numero final: '))
if start > end:
print('Número inicial maior que final. Por favor, tente de novo.')
return
print(palindromo(start, end))


if __name__ == '__main__':
main()

0 comments on commit 0c5ef4e

Please sign in to comment.