LEAP YEAR One of the locked answers are not going don’t know y (showing work ) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

LEAP YEAR One of the locked answers are not going don’t know y (showing work )

Don’t know why examples number 3 and 4 don’t pass and they are locked ones # didn’t fit together with the other question year = int(input()) a = (year % 4) b = (year % 100) c = (year % 400) if a == 0: if b == 0: if c == 0: print ('Leap year') if a or b or c ! = 0: print ('Not a leap year') {added} For any answer just to pass I can do see answer but I’m trying to code the answer my way and trying to understand the how coding works not just getting answers to pass the tests on sololearn so….

22nd Sep 2022, 2:19 AM
Lz1234
3 Answers
+ 1
This might help https://www.wikihow.com/Calculate-Leap-Years I'm not too sure with the working of the second `if` block if a or b or c > 0:
22nd Sep 2022, 3:11 AM
Ipang
0
Compare this with your code and figure out. https://code.sololearn.com/cEZCv6Ldtp0a/?ref=app Alternatively you can write, if a == 0: if (b==0 and c==0) or (b!=0 and c!=0): print('Leap year') else: print('Not a leap year') else: print('Not a leap year') try this
22nd Sep 2022, 6:06 AM
Diksha Sharma
Diksha Sharma - avatar
0
same discussion. else part missing also.. https://www.sololearn.com/discuss/3085077/?ref=app
22nd Sep 2022, 8:08 AM
Jayakrishna 🇮🇳