I am trying to print this line and the string is set:
print('Hello',name,'!','You were born in', age_new)
and I keep getting:
Hello Amanda ! You were born in 2005
How do I get the exclamation point left one space?
I am trying to print this line and the string is set:
print('Hello',name,'!','You were born in', age_new)
and I keep getting:
Hello Amanda ! You were born in 2005
How do I get the exclamation point left one space?
When using print('text','text2')
you will automatically receive a space. So instead you can use old fashion +
for concatinate.
name,age_new = 'bob',45
print('Hello',name+'!','You were born in', age_new)
But I highly highly suggest you move away from + and , and use f-strings
. They are easy and efficient.
name,age_new = 'bob',45
print(f'Hello {name}! You were born in {age_new}')