Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def suman17(n):
- digitos = list(str(n))
- suma = 0
- for d in digitos:
- suma += int(d)
- return suma == 17
- def primeroMayor(n):
- digitos = list(str(n))
- return int(digitos[0]) > int(digitos[-1])
- def digitos2y6(n):
- digitos = list(str(n))
- return "2" in digitos and "6" in digitos
- numeros = []
- for n in range(0, 100_000):
- if suman17(n) and primeroMayor(n) and digitos2y6(n):
- numeros.append(n)
- print(sum(numeros))
Advertisement
Add Comment
Please, Sign In to add comment