How to add on to a String?

Hi guys

Im in need of your help, I’m a beginner Learning how to code and i wanted to ask if anyone knows how to add on to a string format for example i have a code thats says…

d = input (" whats your name ?")
o = input (" how old are you ? ")
n = input (“where are you from ?”)

i = d + o + n

print(i)

After i run this code it comes out to be …

whats your name ? Donovan
how old are you ? 28
where are you from ? Jamaica
Donovan 28 jamaica

I’m asking for help because i wanted to know how can i make this code to come out to say “Donovan is 28 years old and he’s from Jamaica” ?

Try using prompt() instead of input() and console.log() instead of print() :slight_smile:

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://learn.freecodecamp.org.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

1 Like

@ArielLeslie Thanks for you insight.