All right, guys, it's time for the final project of today. So the program that you're going to be
building looks a little bit like this. And you can check it out if you head over to this link, either
by typing it in or heading to the resources page and clicking on the corresponding link.
But essentially, it's a band name generator. And it asks you for a city that you grew up in and the name of your
pet.
And then it combines those together and gives you the name of your band.
There's a couple of things to note here.
Firstly is notice when this input got triggered, the cursor actually showed up on a new line.
So if I run this again, you can see it says "What's the name of city you grew up in?"
And then the cursor is on the next line.
And what I want you to do is to go ahead and head over to this starting project.
So this is the URL
and it's also, of course, in the course resources.
And once you head over here, you can fork this code and complete your own version.
So there's a couple of steps in here as hints.
If you don't want to see these and you just want to go by the end project, you can also just delete
all of these.
But the important thing is once you've completed this project, it should work exactly the same as the
one that you see here.
And in order to do this, you're going to have to apply everything that you learned today, including
printing inputs, variables, new lines, string manipulation, debugging and a whole lot more.
So this is a time to grab yourself a cup of tea 🍵 or coffee ☕️, pause the video and tackle this final project.
All right, guys, I hope you gave that a go and you were able to complete it. If you want to see how
I've implemented it or if you want to just check to see if you have any errors or if there's something
that you're unsure about, then continue watching and I'll go through the solution with you.
The first step is to create a greeting for your program, in our case, it says "Welcome to the band
name generator."
So that's exactly what I'm going to create.
And we print these messages using the print function.
So I'm going to say "Welcome to the band name generator."
And this when I run, it will just print that message.
Now, the next step is to ask the user for the city that they grew up in. So in order to get some input
from the user will need, of course, the input function.
And we're going to ask them using the prompt, which goes inside the parentheses: "Which city did you
grow up in?"
So now when I hit run, it's going to ask me for the city that I grew up in and I'm able to add a reply
like so.
Now, that data is just going to be lost to thin air unless I capture it and I give it a name, so I'm
going to have to create a variable to hold onto the data that the user inputted.
So we'll just call that "city" and then add the equal sign (=) to assign whatever it is that the user typed
in to this variable name.
And now I have access to the city variable and I can print it or use it later on if I want to, like so.
Now, the next step is to ask the user for the name of a pet.
So we'll call that variable "pet" and we'll assign it the value that the user inputs for:
"What is the name of a pet?"
Now, step 4 is to combine the name of the city and the pet and show them their band name.
Now, there's quite a few ways of doing this, especially if you look around on the Internet.
But the way that you learn in today's lessons is using string concatenation.
So we're going to do that.
So we're going to use a print statement and tell them "Your band name could be..."
And then we're going to add the name of the city and then add a space and then add the name of their
pet.
So now when we run our code
it will ask us for the name of their city and then the name of a pet, and then it should combine those
together and show us the name of our band.
Now, the final step is that the input cursor should show on a new line like this.
So here's the cursor.
But here's the input.
Just so that you get a bit of space and you're not typing it in directly after the prompt here like
what we have.
So how do we do that?
Well, you learned about modifying strings by creating a new line using the \n.
And we can add that both to the end of the city input and the pet input.
And now when we run our code, you'll see that the cursor now shows up on the next line and our program
looks a lot better.
So there you have it.
This is how you solve this boss challenge and this is how you create the band name generator project.
So I hope you had fun with me today, learning Python and a lot of the fundamentals of Python.
And tomorrow I've got another jam packed module of really awesome tutorials and challenges and projects
for you to sink your teeth into!
I'm looking forward to seeing you tomorrow, so I have a rest now and let your brain 🧠 work on the things
that you learned while you sleep.
And I'll see you here bright and early.
Good night and see you tomorrow.