Skip to content

Instantly share code, notes, and snippets.

@ryan-blunden
Created November 30, 2021 11:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryan-blunden/34102ae67867458082e9ae105e4012f9 to your computer and use it in GitHub Desktop.
Save ryan-blunden/34102ae67867458082e9ae105e4012f9 to your computer and use it in GitHub Desktop.
Pybites commuity intro message fun
from dataclasses import dataclass
import random
pybites_init_questions = [
'If you were to build a chatbot what would it do'
]
@dataclass
class PybitesIntro:
name: str
use_python_for: str
day_job: float
random_question: str
random_answer: str
def __str__(self) -> str:
return '\n'.join([
'\nHere is your response to paste into the Pybites community Slack\n\n',
f'Hi! I\'m {self.name}!',
f'I use Python for {self.use_python_for}.',
f'My day job is {self.day_job}.',
f'To the question "{self.random_question}"?',
f'My answer would be: "{self.random_answer}".',
'\n\nNice to meet you all!\n'
])
random_question = random.choice(pybites_init_questions)
print(
PybitesIntro(
name=input('\nHi Friend!\n\nWhat is your name: '),
use_python_for=input('What do you use Python for: '),
day_job=input('What is your day job: '),
random_question=random_question,
random_answer=input(f'{random_question}: ')
)
)
@bbelderbos
Copy link

Haha nice, maybe this could be a PR on https://github.com/PyBites-Open-Source/karmabot ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment