Skip to content

Instantly share code, notes, and snippets.

@noeldelgadom
Created April 5, 2017 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noeldelgadom/273fe15f3ef229ecf6b3e34fb2f2ef4d to your computer and use it in GitHub Desktop.
Save noeldelgadom/273fe15f3ef229ecf6b3e34fb2f2ef4d to your computer and use it in GitHub Desktop.
Challenge 1 y 2
def challenge1(lista,element):
if element in lista:
return "I found the element in index %d" % lista.index(element)
else:
return "Sorry, i couldn't find your element"
def challenge2(lista):
total = 1
for i in lista:
total *= i
return total
lista = [1,2,3,4,5,6,7]
element = 3
print(challenge1(lista,element))
print(challenge2(lista))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment