class Stack: def __init__(self): self.stack = [] def add(self, dataval): # Use list append method to add element if dataval not in self.stack: self.stack.append(dataval) return True else: return False # Use peek to look at the top of the stack def peek(self): return self.stack[-1] AStack = Stack() AStack.add("Mon") AStack.add("Tue") AStack.peek() print(AStack.peek()) AStack.add("Wed") AStack.add("Thu") print(AStack.peek())
Getting to know API
- API stands for application programming interface
- An interface, that allows different systems to talk to each other without having to understand exactly what each other does
Type of API's
- APIs can come in many forms or shapes
- APIs, used for actions like turning on your camera and audio for joining a Zoom call
- Or they can be web APIs, used for web-focused actions such as liking images on your Instagram or fetching the latest tweets.
How Api's are operated(in simple terms)
You usually make a request for information or data, and the API returns a response with what you requested.
Comments
Post a Comment