Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
first commit
- Loading branch information
oshianor
committed
Nov 14, 2022
0 parents
commit e42ec4dcfaecfc7a0d594253d2a686e010f288f4
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
BIN
+460 Bytes
data/__pycache__/user.cpython-310.pyc
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class User: | ||
def __init__(self, name, phoneNumber): | ||
self.name = name | ||
self.phoneNumber = phoneNumber | ||
|
BIN
+1.39 KB
logic/__pycache__/welcome.cpython-310.pyc
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from data.user import User | ||
|
||
class Welcome: | ||
|
||
def welcomeUser(self): | ||
print("Welcome to crypto chat-box.\n") | ||
print("Where we make it easier for you to access realtime prices from your favourite coin") | ||
print("To enable your experience smooth, We've created a helper function to help do this faster with a shortcut.\n") | ||
|
||
# get the user name | ||
name = self.provideName() | ||
|
||
print("\nThank you for providing your name. We just need one last thing from you.") | ||
|
||
# get the mobile number | ||
phoneNumber = self.providePhoneNumber() | ||
newUser = User(name, phoneNumber) | ||
|
||
def provideName(self): | ||
name = str(input("how can we address you. Please provide your name: \n")) | ||
if name == "": | ||
print("To proceed, you must provide a name.") | ||
self.provideName() | ||
return name | ||
|
||
def providePhoneNumber(self): | ||
phoneNumber = str(input("Please provide your mobile number: \n")) | ||
if phoneNumber == "": | ||
print("To proceed, you must provide your mobile number.") | ||
self.providePhoneNumber() | ||
return phoneNumber |
9
main.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from logic.welcome import Welcome | ||
|
||
def main(): | ||
newWelcome = Welcome() | ||
# Welcome the user and get their private information | ||
newWelcome.welcomeUser() | ||
|
||
if __name__ == "__main__": | ||
main() |