+ 3
Please explain why this code is wrong.
Please tell me whats wrong with this code. This is a day calculator.It takes input of a beginning month and year and an ending month and year,and calculates the number of days inbetween.I am new to python,and my logic might be ridiculous for experienced coders,but please tell me why this code doesnt work.in sololearn,it says time limit exceeded,and in jupyter,it doesnt print the number of days.Seems like the loop won’t end. https://code.sololearn.com/cegORpj49aS6/?ref=app
9 Réponses
+ 6
You have to change "&" with "and" as "&" is for bitwise operation and “and “ is a logical operator
+ 6
I tried to initialize norse and dayzee to 0 outside the while loop and still got the time limit exceed error
+ 6
And also when month equals 4, 6,etc norse should be 30, not 31
+ 1
no i have saved the ending year and month as variables year2 and month2
+ 1
please review the code sir.it doesnt work in pc either.Wont execute the last 2 commands
+ 1
Bishu Giri,i am afraid that you are pathetically dimwitted,and are incapable and incompetent of coding.
+ 1
Bishu Giri we ought not to deny the truth.
- 1
What exactly are you trying to achieve with this code? Give more examples
- 1
I'm afraid you will continue being at same level with the attitude. focus on your development