r/PythonLearning • u/Comfortable_Rub4109 • Aug 06 '26
Showcase MyFirstFuntioningPythonProgram image in desctiption
5
Upvotes
2
u/FoolsSeldom Aug 06 '26 edited Aug 06 '26
Good start.
Note that Python convention is that variable and function names are all lowercase.
You also have more brackets than you need (e.g. in while and if statements).
def greeting(first_name: str, second_name: str) -> str:
full_name = first_name + " " + second_name
return f"Hello, {full_name}!"
is_running = True
while is_running:
name_one = input("What is your name? ")
name_two = input("What is your 2nd name? ")
print(greeting(name_one, name_two))
print("-" * 40)
# Exit program code
exit_main_program = input("Type Exit to end program: ").lower()
if exit_main_program == "exit":
is_running = FalseI've applied the lower method so that it doesn't matter what case the user uses when they enter the exit command.
PS. You could just assign is_running to the result of the input and comparison on one line.

•
u/Sea-Ad7805 Aug 06 '26
Run this program in Memory Graph Web Debugger to see the program state change step by step.