Thanks in advance. I am stuck on a part of my homework (I know this is basic stuff)
this is the assignment:
Your program should ask the user for his/her first name using the Python input function.
Your program should ask the user for his/her last name using the Python input function.
Your program should create two greetings using the user’s first and last name that look like this:
SEC 290 welcomes Cameron Diaz to the World of Python, assuming the user’s name is Cameron Diaz.
The first greeting should be constructed using string concatenation.
The second greeting should be constructed using the string format method.
Display each greeting using a print statement.
This is what I have so far. I am able to get everything except the string formatted method.
so after reading my post to ensure accuracy, I noticed I forgot to put (to the World of Python) in my first greeting. I attempted to do the following but it does not work so that may be problem #2
this is the assignment:
Your program should ask the user for his/her first name using the Python input function.
Your program should ask the user for his/her last name using the Python input function.
Your program should create two greetings using the user’s first and last name that look like this:
SEC 290 welcomes Cameron Diaz to the World of Python, assuming the user’s name is Cameron Diaz.
The first greeting should be constructed using string concatenation.
The second greeting should be constructed using the string format method.
Display each greeting using a print statement.
This is what I have so far. I am able to get everything except the string formatted method.
# Sec 290 # July 08, 2019 # Week 1 Programming assignment first = input("What is your first name:") last = input("What is your last name:") # string concatenation print("Sec290 welcomes " + first , last ) # string format print("Sec290 welcomes
so after reading my post to ensure accuracy, I noticed I forgot to put (to the World of Python) in my first greeting. I attempted to do the following but it does not work so that may be problem #2
print("Sec290 welcomes " + first , last "to the World of Python ")