We have an assignment to create a code where there is user input and it should print out like this.
What is your name? Amanda
How old are you? 2005
Hello Amanda! You were born in 2005.
My Code:
user_name = input('What is your name?')
user_age = int(input('How old are you?'))
birth_year = (2021 - user_age)
print()
print('Hello', user_name, '!', 'You were born in', birth_year, '.')
My Output:
What is your name?'nikki'
How old are you?'27'
()
('Hello', 'nikki', '!', 'You were born in', 1994, '.')
Process finished with exit code 0
I can't figure out how to get the parentheses to not go around the output print string. I am doing everything we were taught so super confused. I also have to enter the input in '' or else it won't work.I've tried separating the string into two separate print strings. That didn't work. Also tried changing the commas to + which was even more of an error.