I got to thinking about what ndc85430 said in one of my post, and was wondering if this would roughly fall along those lines.
Classes could be added or removed without affecting the others.
All classes could have a relation with the Register class or other class within the program.
Just trying to get a basic understanding.
Thanks for any input.
Sorry, I should have placed this in the news and discussions.
Classes could be added or removed without affecting the others.
All classes could have a relation with the Register class or other class within the program.
Just trying to get a basic understanding.
Thanks for any input.
#! /usr/bin/env python3 class Register: def __init__(self): self.first_name = '' self.last_name = '' self.email = '' class Email(Register): def __init__(self, email): print(f'Sending confirmation email to {email}') class Display(Register): def __init__(self, first_name, last_name, email): print(f'Hello {first_name.title()} {last_name.title()}\nYour email is {email}') # Initial registration newuser = Register() newuser.first_name = 'John' newuser.last_name = 'Doe' newuser.email = f'{newuser.first_name}.{newuser.last_name}@domain.com' # Display the information. Can be changed without affecting registration Display(newuser.first_name, newuser.last_name, newuser.email) # Sending the confimation email Email(newuser.email)
Sorry, I should have placed this in the news and discussions.
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts