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
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
All right guys in the next lesson I've got a leap year coding challenge for you and this is a really
interesting challenge although it is a little bit challenging but it's really cool because have you
ever wondered what makes a particular year a leap year and what makes another year not a leap year.
And it's easy enough to say that every four years it's a leap year.
But if you just got given a random year and you had to work out if it was a leap year then there's actually
rules that you can follow to figure this out.
So the rules are that on every year that is evenly divisible by four it's a leap year except every year
that is evenly divisible by 100.
So it.
So if it's divisible by four but it's divisible by 100 then it's not a leap year unless that year is
also evenly divisible by 400.
So the rules are a little bit complex but it might be easier if you look through some of the examples.
So for example if we wanted to figure out whether if year 2000 is a Leap Year 2000 divide by four divides
cleanly 500 with no remainder.
So it's a leap year when we divide 2000 by 100 then it's 20.
So it also divides cleanly.
So it's actually now not a leap year but but but 2000 divide by 400 equals five with no remainder.
So finally it actually is a leap year and you can look through the different examples and also look
at and also if you scroll down you can take a look at this Web site of known leap year and they show
you step by step each of the rules that we talk through just now and you can test different years such
as the year 2000 and you can see it step by step to see how they figured out whether if it is a leap
year or not.
Now I also recommend actually watching this video that I linked to up at the top.
If you're not familiar with the concept of leap year and even if you do understand leap year it's still
a fantastic video to really understand how we're adjusting for a mismatch in the Earth's rotation with
the seasons.
So I recommend taking a look at the video reading through each of these statements and taking a look
at the known leap year and the Web site that it links to and then to start thinking about how you would
write this logic.
Now in order to map out the logic I recommend creating a flowchart of your own on drawdown IO and to
use the flowchart to see how your code should flow.
Now if you want a little bit of extra help I'm about to reveal the flowchart that I've created.
If you want to first try to create your own and see if you get it right then pause the video now.
All right.
So let's take a look at the flow chart that I created.
If you click on this link in hint number three you'll be taken to a page that looks like this.
And so if we map out those rules and we click start we see is it clearly divisible by four.
If no then it's definitely not a leap year but if it is then we have to check the next thing is it cleanly
divisible by 100.
No.
Well then it's definitely a leap year.
But if it's yes then we have the check.
The final thing is it cleanly divisible by 400.
If yes then it's a leap year.
If no it's not a leap year.
And that flowchart basically translates these three lines of logic.
Now if English is not your first language then I recommend to take a look at the flowchart and also
take a look at the rules for leap here in your own language.
But once you're happy that you understand what's going on then it's time to tackle the challenge and
write your code.
Now remember you have to output exactly the words leap here full stop or not leap here.
Full stop and look at the capitalization and where the spaces and full stops go that way when you check
solution.
It'll actually be a partial code if everything is correct.
So head over to the next lesson and tackle this challenge now.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.