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
{ | |
"code": "00", | |
"message": "success", | |
"data": { | |
"code": "00", | |
"message": "success", | |
"accountHolderName": "RAMIREZ CARDOZO MOYA", | |
"entityId": "0063743758", | |
"accountType": "ACCT", | |
"statement_result": [ |
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
{ | |
"code": "06", | |
"message": "\"invalid.account\"", | |
"data": { | |
"message": [ | |
{ | |
"Amount": { | |
"dollarSign": { | |
"currencyCode": "MXN" | |
}, |
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
import itertools | |
def areAdjacent(word1, word2): | |
count = 1 # Initialize at 1 given words can deviate by 1 letter | |
list1, list2 = list(word1), list(word2) # Make lists out of the words | |
zipped = zip(list1, list2) | |
for pair in zipped: # A pair is (0,0) where 0 denotes the position on the word | |
if pair[0] is pair[1]: # Check if the letters at the positions are the same | |
count += 1 | |
return True if count is len(word1) else False |
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
class Circle(object): | |
classType = "circle" | |
def __init__(self, name): | |
self.name = name | |
def setRadius(self, radius): | |
self.radius = radius | |
def getArea(self): | |
return "%s is a %s and has an area: %s" % (self.name, self.classType,3.1416*self.radius**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
class Triangle(object): | |
classType = "triangle" | |
def __init__(self, side1, side2, side3): | |
self.side1 = side1 | |
self.side2 = side2 | |
self.side3 = side3 | |
def area(self): | |
return "The area of this %s is: %s" % (self.classType,self.side1 * self.side2 / 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: |