Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1
All right, guys, it's time for the final project of today. So the program that you're going to be
2
building looks a little bit like this. And you can check it out if you head over to this link, either
3
by typing it in or heading to the resources page and clicking on the corresponding link.
4
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
5
pet.
6
And then it combines those together and gives you the name of your band.
7
There's a couple of things to note here.
8
Firstly is notice when this input got triggered, the cursor actually showed up on a new line.
9
So if I run this again, you can see it says "What's the name of city you grew up in?"
10
And then the cursor is on the next line.
11
And what I want you to do is to go ahead and head over to this starting project.
12
So this is the URL
13
and it's also, of course, in the course resources.
14
And once you head over here, you can fork this code and complete your own version.
15
So there's a couple of steps in here as hints.
16
If you don't want to see these and you just want to go by the end project, you can also just delete
17
all of these.
18
But the important thing is once you've completed this project, it should work exactly the same as the
19
one that you see here.
20
And in order to do this, you're going to have to apply everything that you learned today, including
21
printing inputs, variables, new lines, string manipulation, debugging and a whole lot more.
22
So this is a time to grab yourself a cup of tea ๐ต or coffee โ๏ธ, pause the video and tackle this final project.
23
All right, guys, I hope you gave that a go and you were able to complete it. If you want to see how
24
I've implemented it or if you want to just check to see if you have any errors or if there's something
25
that you're unsure about, then continue watching and I'll go through the solution with you.
26
The first step is to create a greeting for your program, in our case, it says "Welcome to the band
27
name generator."
28
So that's exactly what I'm going to create.
29
And we print these messages using the print function.
30
So I'm going to say "Welcome to the band name generator."
31
And this when I run, it will just print that message.
32
Now, the next step is to ask the user for the city that they grew up in. So in order to get some input
33
from the user will need, of course, the input function.
34
And we're going to ask them using the prompt, which goes inside the parentheses: "Which city did you
35
grow up in?"
36
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
37
like so.
38
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
39
going to have to create a variable to hold onto the data that the user inputted.
40
So we'll just call that "city" and then add the equal sign (=) to assign whatever it is that the user typed
41
in to this variable name.
42
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.
43
Now, the next step is to ask the user for the name of a pet.
44
So we'll call that variable "pet" and we'll assign it the value that the user inputs for:
45
"What is the name of a pet?"
46
Now, step 4 is to combine the name of the city and the pet and show them their band name.
47
Now, there's quite a few ways of doing this, especially if you look around on the Internet.
48
But the way that you learn in today's lessons is using string concatenation.
49
So we're going to do that.
50
So we're going to use a print statement and tell them "Your band name could be..."
51
And then we're going to add the name of the city and then add a space and then add the name of their
52
pet.
53
So now when we run our code
54
it will ask us for the name of their city and then the name of a pet, and then it should combine those
55
together and show us the name of our band.
56
Now, the final step is that the input cursor should show on a new line like this.
57
So here's the cursor.
58
But here's the input.
59
Just so that you get a bit of space and you're not typing it in directly after the prompt here like
60
what we have.
61
So how do we do that?
62
Well, you learned about modifying strings by creating a new line using the \n.
63
And we can add that both to the end of the city input and the pet input.
64
And now when we run our code, you'll see that the cursor now shows up on the next line and our program
65
looks a lot better.
66
So there you have it.
67
This is how you solve this boss challenge and this is how you create the band name generator project.
68
So I hope you had fun with me today, learning Python and a lot of the fundamentals of Python.
69
And tomorrow I've got another jam packed module of really awesome tutorials and challenges and projects
70
for you to sink your teeth into!
71
I'm looking forward to seeing you tomorrow, so I have a rest now and let your brain ๐ง work on the things
72
that you learned while you sleep.
73
And I'll see you here bright and early.
74
Good night and see you tomorrow.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.