Leap year challenge | Sololearn: Learn to code for FREE!

+7

Leap year challenge

ive been trying to complete the leaping year coding challenge in beginner python but i cant find any success i would appreciate any help regarding the matter ive tried many times and just ended up frustrated

4/26/2021 8:46:06 PM

Mwsdo

26 Answers

New Answer

+2

AI is a large area that includes Machine Learning, Data Science, and Deep Learning, so focus on each of them first. Sololern offers two courses: Machine Learning and Data Science. Python is best suited for this purpose. you can take all five python courses, including the Python course for Data Science. https://code.sololearn.com/We1wBnzl6Sos/?ref=app

+2

A year for example 2004 when divided by 4 gives a quotient 501 leaving a remainder 0(the year 2004 was leap year) , but when you divide 2014 by 4 then it gives a quotient 503 leaving a remainder 2(the year 2014 was not a leap year) . So at last the conclusion is when a year is divided by 4 and gives a remainder 0 is called a leap year(Mathematically). The Python3 code goes like this: year = int(input()) if year % 4 == 0: print("Leap Year") elif year % 4 != 0: print("Not a Leap Year") else: print("entet a valid year")

+1

Try to search Code Playground for code examples, see and learn how others are doing it, compare with your logic, and observe where a mistake is in your tryout code šŸ‘

+1

Please, show us your code attempt! We will find mistakes!

+1

or show your solution logic. the task describes the algorithm for the program in great detail. where are you stuck?

+1

year = int(input()) #your code goes here if year % 4 == 0 and year % 100 != 0: print ("Leap year") else: print ("not a leap year") if year % 400 == 0 print ("leap year") else: print ("not a leap year")

+1

first, you need to capitalize all the small first letters in the answers, otherwise the test will not miss even the correct answer

+1

then you have one syntax error in your code. did you find her?

+1

Right! now start debugging the code: in the first test, the correct answer is printed twice, in the second test - both correct and incorrect. delete the section of code that is responsible for this or change your program so that at least one test is printed correctly. your logic as a whole fails

+1

with help of some helpful people like you i completed all the challenges till the while loop points challenge

+1

in this case, continue learning further

+1

I'm no expert in AI but here are some blogs and websites that may help, you may also want to use your browser's search engine. https://thenextweb.com/podium/2019/09/13/11-ways-novices-can-start-the-process-of-learning-ai-programming/ https://towardsdatascience.com/i-want-to-learn-artificial-intelligence-and-machine-learning-where-can-i-start-7a392a3086ec https://bigdata-madesimple.com/want-get-started-artificial-intelligence-7-easy-steps/ SoloLearn also has a Machine Learning course (related to AI). https://www.sololearn.com/Course/machine-learning/?ref=app There are many Youtube videos, courses, books and more learning resources that may help you.

+1

I hope you want to become an ethical hacker? Most useful threads for hacker https://code.sololearn.com/Wurr9SQeKmLs/?ref=app https://code.sololearn.com/WQwT5yGmS5pr/?ref=app https://code.sololearn.com/W0mcYu070ZCE/?ref=app https://code.sololearn.com/WkoagipqGYeZ/?ref=app https://www.sololearn.com/discuss/729770/?ref=app https://www.sololearn.com/discuss/217414/?ref=app https://www.sololearn.com/discuss/1093493/?ref=app https://www.sololearn.com/discuss/1266617/?ref=app https://www.sololearn.com/discuss/978754/?ref=app https://www.sololearn.com/discuss/1119261/?ref=app https://www.sololearn.com/discuss/2019438/?ref=app https://www.sololearn.com/discuss/380375/?ref=app https://www.sololearn.com/discuss/1748654/?ref=app https://www.sololearn.com/discuss/552254/?ref=app https://www.sololearn.com/discuss/312914/?ref=app https://www.sololearn.com/discuss/1054631/?ref=app https://www.sololearn.com/discuss/311356/?ref=app https://www.sololearn.com/discuss/1749600/?ref=app https://www.sololearn.com/discuss/2086692/

+1

https://code.sololearn.com/cG438K3NidD4/?ref=app

0

yes i forgot the :

0

thanks i got it correct now

0

You passed all tests???

0

may I congratulate you?

0

You mean 25.1 lesson?

0

i did all the lessons till 28 the bmi calculator now im working on the challenges