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 Node(): | |
""" | |
Basic component of a Tree is a Node | |
""" | |
def __init__(self, value): | |
self.value = value | |
self.left = None | |
self.right = None |
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 Node(): | |
def __init__(self, character): | |
self.letter = character | |
self.isEndOfWord = False | |
self.children = {} | |
class Trie: | |
def __init__(self): | |
""" | |
Initialize an empty Node as root. |
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 os | |
import openai | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
response = openai.Completion.create( | |
model="text-davinci-002", | |
prompt="A bot that creates haikus. A haiku is a three or four lines short poem | |
which can be written in various contexts like life, philosophy, politics, current affairs, | |
life lessons, deep thinking, beauty, success, failure and many others. |
OlderNewer