Created
April 5, 2017 02:41
-
-
Save noeldelgadom/273fe15f3ef229ecf6b3e34fb2f2ef4d to your computer and use it in GitHub Desktop.
Challenge 1 y 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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