forked from Code2College-Content/c2c-elite101-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
27 lines (19 loc) · 796 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Welcome to Elite 101 this program is a starter for your chatbot project.
The starter prompts the user to enter their name and then greets them with a personalized message.
Functions:
get_user_name(): Prompts the user to enter their name and returns it.
greet_user(name): Prints a greeting message using the provided name.
main(): Main function that orchestrates the user input and greeting process.
Execution:
When the script is run directly (not imported as a module), it will execute the main() function.
"""
def get_user_name():
return input("Please enter your name: ")
def greet_user(name):
print(f"Hello, {name}!")
def main():
user_name = get_user_name()
greet_user(user_name)
if __name__ == "__main__":
main()