Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
1

does anyone know how to make it print a sentence with persons name in it

yomicroyeewww
yomicroyeewww

i want to make it orint a persons name with a sentence in it

2 years ago
You are viewing a single comment. View All
1
JBloves27
JBloves27

I think it would be better if you were more descriptive, but if you mean f strings, here it is:

# Here it is: name = input("what is your name?") print(f"Hello {name}!") # Output: What is your name? input name here. # Output: Hello name # This works, or you can do this:
# This works as well: name = input("What is your name?") print("Hello",name,"!") # Output is same # Another way:
name = input("what is your name?") print("Hello"+name+"!") # output is same

Last one:

name = input("what is your name?") print("Hello %s!" % name) # output is same

I hope this helped!

2 years ago