Afrikaans
Akan
Albanian
Amharic
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
French
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 (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
Throughout this course, we'll be getting you involved in a lot of these interactive coding exercises.
And the idea is that you're not just sitting here watching me talk, that you're actually putting everything
you're learning into practice.
That way it actually becomes your own.
It's a great because we can give you instructions and show you what should happen if you write the correct
code, what it needs to do, and you'll be able to write your code as well as see it run in the console.
Once you're done with your code, you'll be able to submit it and see the tests run.
And if you've written the code correctly, then all of the tests will pass.
If your code isn't doing what it's supposed to.
Then when you click submit, you'll get feedback and you'll see what it's meant to do and what your
code is actually doing.
So you'll be able to use that to figure out what's wrong and fix your code.
And it's through a lot of these exercises that you're going to level up and you're going to become a
better coder.
Now, in order for you to get set up on our coding rooms, we're going to have to get you signed up
and registered with our course.
So in order to do this, I want you to first head over to codingrooms.com and then sign up for
a student account.
Now this is completely free and all you have to do is just do click, sign up, putting your email and
password, and then you can choose student for this question Who are you?
And then putting your first name and last name and click "Finish". Next,
in order to get hold of the Joining Link, I want you to go to the course resources for the current
lesson on Udemy.
So the lesson is "[Interactive Coding Exercise] Printing", and then I want you to click on the dropdown
list and you should see step one sign up to coding rooms, which you should have already done.
And then step two is join our coding room.
So I want you to click on that link.
And once you've clicked on that link, then it should automatically enroll you into our 100 days of
code, the Complete Python Pro Bootcamp, and you should now be able to see every day's corresponding
interactive coding exercises.
So for example, on day one there are four exercises and they are named exactly the same as what you
see in Udemy.
So this is interactive coding exercise one which is printing, debugging, practice, input, function
and variables and you see all the same ones over here that you'll be able to attempt.
Now the next time when you log in, all you have to do is just go into your courses and you should see
the interactive coding exercises for the 100 days of code, and you will be able to continue where you
left off.
Now let's get started with the first exercise.
That's the objective of this lesson.
So we're going to go into day one and it might be collapsed.
If so, just go ahead and expand it and then click on Exercise 1 - Printing.
And here you see the instructions for what you need to do in order to complete this coding exercise.
Now, I want you to go ahead and click on Open Assignment Workspace, and here you'll be able to see
the instructions on one side of the pane.
You'll be able to have your main.py, which is where you write your code.
So all the lines below here, you can just type your code out.
And then once you're done writing your code, I want you to test it by running your code.
So hitting this run button and you'll see the result of your code being run in the console down here.
Now once you think you've completed the coding exercise according to all the instructions over here,
I want you to go ahead and test your code and you can test your code by simply hitting submit.
Now, don't worry about all of this where it says this submission will count towards your grade for
the assignment.
There are no grades, there's no time limits.
Nobody is going to check what you've done.
It's all for the benefit of your learning so you can submit your code as many times as you like.
So once you hit submit, it's going to run the automated test that we've set up behind the scenes,
and it's going to check to make sure that your code is doing what it's supposed to do.
So, for example, in this case, my tests have not passed because there's a cross here and note that
sometimes there'll be more than one test, so you can scroll down and see the other ones.
And the reason why I didn't pass, as they've shown here, is this is my actual output.
This is what my code did and this is what the expected output is supposed to be.
And there's a whole bunch of differences.
This does not look like this, so then we have to go and fix it.
And I've left some feedback in some of the lessons to help you in case you get stuck.
But also there are hints in some of the instructions.
So just make sure that you read everything now if you want to, or if you get really, really stuck,
you can take a look at the solution.
Now, I don't recommend looking at the solution code unless you're actually just checking to make sure
that.
Something hasn't gone majorly wrong or you're not completely stuck, or just for whatever reason, I
really, really want you to persevere and try your best to actually write the code yourself and to solve
the issues and figure out how to make all the tests pass.
But if you need to look at the solution, they are available on replit.
So just click on this link and it'll take you to the solution page in order to see the files.
You can either fork the repl as you have done before.
You'll get a copy of this solution file or what I think is much simpler is simply click on show files
and then click on this main.py file and then you will see the solution code on this page without
having to fork a copy of this repl.
But you can do it any number of ways.
Whichever way suits you best is fine.
Now, once you have written your code correctly, you should be able to see all the tests pass and by
passing it means that there's a little tick along each of these.
And usually in this one there's only one test and this is passed.
So you get a score of 100%.
And the actual output that your code has created in the console now looks exactly the same as expected.
So you are now done and you can go back to your other assignments and you can continue.
So this is a really simple interface and we've switched to this from replit because replit had actually
disabled their classroom technology, which looks basically exactly the same as this.
And we wanted to provide you the best learning experience possible.
So we've switched over to coding rooms and you should be able to sign up and get started without any
issue.
Now remember at the end of the lesson, I will go through the solution with you step by step explaining
the solution as well.
So if you get stuck, don't worry, I'm here for you every step of the way.
But now it's time for you to pause the video and make sure that you've signed up for coding rooms,
already registered for a student account, and then click on the link in step two in the course resources
and sign up for our course and then go over to the first exercise printing and give it a go.
All right, pause the video now.
All right.
How did you get on?
I really hope you gave this a good go because it's in these moments where you're going to be learning
the code.
Unfortunately, no amount of listening to me talk is actually going to give you these skills.
It's only when you actually try it out and get the computer to do the thing that you wanted to do.
That's when you become the master of the computer, also known as a programmer.
So in this case, the instructions are pretty simple.
We have to use what we learn about the print statement to output these three lines and notice how in
this gif the lines are printing out in separate lines.
This one gets printed, then this one, then this one.
But because it happens so fast, it seems like it as if they're getting printed as a single block.
So we're told to write our code below this line.
And we know that in order to print something, we use the print function with a set of parentheses,
and inside the parentheses is where we tell it what we want it to print.
So in the first instance, it's day one space, then it's now it's really easy to make spelling mistakes.
But I really encourage you to actually type out anything that you put into your code rather than just
simply copying and pasting it.
Now, of course, it works exactly the same way.
I could just copy and paste the code in here, but it's often in these cases where you make mistakes,
like for example, forgetting to add the double quotes around the text that you want to print, I really
recommend just typing out the code for practice whenever you're doing these code challenges.
Now, the last line that we want to print is a little bit complicated.
It's almost like print inception, because what we want to print is this function.
This is how we write our function, and that has to go inside here, inside a set of double quotes.
So let's open up a double quotes and then write our print statement.
And in this case, I'm actually using a single quote.
And I'll tell you just in a little moment why that is.
So let's add that single quote.
And finally, the closing parentheses.
This now is the entire code that you would need to be able to print something out.
And when I go ahead and click Run, you can see that the output looks exactly the same as what we've
got here in the gif.
This is what we want.
And when I click submit you'll see that my tests all pass and I can now submit my assignment and I've
now completed the coding challenge.
Now coming back to this single quote, why is it that I've got a single quote here rather than a double
quote, which is what we've been using all this time?
Well, because in.
Python.
It doesn't actually care whether if you enclose the strings.
So these pieces of text are not to be interpreted as code inside single quotes or inside double quotes.
It is identical to the computer.
This honey badger literally doesn't care.
But if you had a set of double quotes and then you wanted another set of double quotes inside the double
quotes.
So, for example, if I replace this with double quotes, you'll see that already the syntax highlighting
is already screaming out to us.
There's something that's not quite right here because the colors are not the same as here, where the
print function is in a particular color, the parentheses are in a particular color, and the text that
is to be printed in, it's in a yet another different color.
In this case, it looks all jumbled up and we're getting some errors here.
So now if I hit run, you'll get syntax errors.
And the problem here is, of course, this is of course, our code things at the end of this string
is here.
And so it doesn't know what on earth is going on afterwards.
And instead it's seeing this as a string, this as a string, and this is being interpreted as code.
So when we want to use some double quotes inside another set of double quotes, commonly you'll see
people switch to single quotes instead.
So you could, for example, write the print statement like so and use double quotes if you want to
print those out.
Or you can do it the other way, which is what I had before, where we use our double quotes on the
outside and single quotes on the inside.
So have a play around with that, if that's at all confusing.
But once you've tried it a few times and switched it around a few times, it should become clear what
it's actually doing.
How did you get on with this challenge?
If you ever need to see the solution, it's always down here as a link.
So I hope you enjoy this challenge.
In the next lesson, we're going to get back to learning about Python and we're going to learn about
strings and string manipulation for all of that and more.
I'll see you there.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.