Jan-15-2022, 05:00 PM
(This post was last modified: Jan-15-2022, 05:11 PM by Yoriz.
Edit Reason: Added code tags
)
I needed to create a code to get users age and name and then have the output (input examples John, 33) be Hello John! You were born 1989. current output is Hello John ! You were born in 1989 .
Here is the code I made so far
Here is the code I made so far
# Create an integer variable of the current year. current_year = int(2022) # Prompt the user for their name and save to string variable. my_Name = input("What is your name?\n") # Prompt the user for their age and save to int variable. my_age = int(input("How old are you?\n")) # Format users info to show "Hello ______!, you were born in______." Subtracted current_year from my_age to get year born. print( 'Hello' , my_Name, '!' , 'You were born in ' , current_year - my_age, '.')Any clue how to remove just those two spaces?