Leap Year Code issues | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Leap Year Code issues

Hey yā€™all, attached is an attempted script for finding leap years. Iā€™ve tried a few different ways (ie quotes around 0, no quotes, spaces between % and numbers, no spaces around % and numbers) and always get ā€œinvalid syntaxā€. What am I missing? Thanks in advance! https://code.sololearn.com/c7531c01xfzm/?ref=app

2nd Aug 2022, 6:44 PM
Austin Lindquist
Austin Lindquist - avatar
2 Respostas
+ 1
Austin Lindquist , you cannot compare int with string ("0") in your if and elif clauses. Also you can shorten the code for example this way. https://code.sololearn.com/c9y2dPNXVR3M/?ref=app
2nd Aug 2022, 7:02 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
+ 1
Oh ok, awesome! Thank you. Yeah, I tried 0s w/ & without the ā€œā€ marks, but still invalid. Its honestly been a while since ive been here, so trying to get refreshed lol. But thanks! I appreciate the help & tip!
2nd Aug 2022, 7:09 PM
Austin Lindquist
Austin Lindquist - avatar