# A program that greets the user and performs a simple calculation
# Step 1: Greet the user
print( "Hello, welcome to the Python program!" )
# Step 2: Ask for the user's name
name = input( "What's your name? " )
# Step 3: Personalize the greeting
print( f"Nice to meet you, {name}!" )
# Step 4: Perform a simple calculation
print( "Let's do a quick math calculation." )
num1 = float( input( "Enter the first number: " ) )
num2 = float( input( "Enter the second number: " ) )
# Step 5: Add the numbers and display the result
result = num1 + num2
print( f"The sum of {num1} and {num2} is {result}." )
# Step 6: Say goodbye
print( f"Thanks for trying this program, {name}! Have a great day!" )
|