BLACK FRIDAY EXTRA SAVINGS EVENT - EXTENDED
START FREE

DQ not validating answer if not EXACTLY alike

Hey, guys!

I’ve been facing problems with the DQ exercises all day.
If I don’t have an answer exactly like DQ, it wont validate.

Here’s an example:

In this exercise, I wrote the following code:

decade_frequency = {}

for dec in decades:
if dec not in decade_frequency:
decade_frequency[dec] = 1
else:
decade_frequency[dec] += 1

After submitting my answer, it tells me my “decades_frequency” variable is incorrect.

I copy and past from the answer:

decade_frequency = {}

for d in decades:
if d not in decade_frequency:
decade_frequency[d] = 1
else:
decade_frequency[d] += 1

And then it tells me it’s correct, even though the only difference is that I used the variable “dec” and not “d”.

This happened in other exercises too, and sometimes the only difference was that I didn’t skip a line.
Could someone help me out?

1 Like

hi @cath.gmachado

Not sure how much this would help, but have you tried a hard refresh?

i have the same issue and Hard refresh not working, also i remember that i had a similar issue in 2018 around feb or march 2018. How is it possible that this issue has still not been sorted out. Where is DQ struggling i dont understand it. How are you guys adding loads and loads of gr8ly titled courses/course-works and still have no real answer to this?. I mean 4 yrs almost now. And i am paying 50$ a month for this?

Hi @neo.vandamme1, I’m sorry you’re having such a hard time with the system accepting your answers. Can you please provide a link to the lesson screen that’s giving you a hassle? I’m curious if it’s acting the same way for all users…

I tried to recreate the error from the OP but their code is accepted by the system now.

@mathmike314 Yes, the screen is exactly the same one as @cath.gmachado is talking about in above post. Same lesson same part of assessment. Also there is another one which is a part of the advanced python principles (i believe intermediate in Pandas or Dataframe assessments), I will find it out and put a comment on that lesson post as well.
Will add your tag to it for reference incase you need it.
Thankyou.

Probably some un-important trivia about this situation :-
(Being honest, this bug has been here since Jan 2018 and i thot since that year was one of the beginning yrs on the updated python course work so i let it slide assuming that it may be a known bug/issue and might be amidst a code-fix event or some related monthly sprint. However when I start seeing the same thing in “practically - 2022” now, its just hillarious and quiet honestly frustrating at the same time. Trust me, i dont like to complaint much at all really, because writing feedbacks and complaints and explanatory questions is extremely realllllly time consuming job and i would rather save it and use that time-space to cover more skills, but there comes a point in time(lol, especially after 4 years XD XD) when certain species of animals like myself would simply not be able to progress/proceed further without getting clarity or having a still-unclear past event like this at back of my mind, so then i end up writing essay-like feedbacks/complaints wondering whats really going on. I rather be working for DQ if i keep putting up so many non-assessment based posts you know, thats literally what testers and SDETS generally do kind-of, trying to get clarity about requirements and do gap anlysis etc etc. Well anyways for what its worth i hope this sheds some light about my rant-ish behaviour that i have been exuding recently. Is generally not how i am. Am basically against this quality myself lol.)
Feel free to collapse this text to avoid distraction from the subject-matter, i dont know how to create a collapsible text.

That’s really weird; I tried this screen using @cath.gmachado 's original code and it was accepted by the system. I wonder why you’re getting a different result than me? Can you share the code you’re using and a link to the specific screen in the lesson where you’re able to generate an error? What happens when you use cath’s code on this screen? Is it accepted by the system like me?

1 Like

Apologies I don’t have premium access. Any suggestions @Sahil?

1 Like

Tagging @nityesh about this. fyi @Rucha: Sahil no longer works in the front end of DQ (he now works more with the ticketing system in the backend).

1 Like

Mine got accepted too. Supposing I’m using the exact code from the answer and also @cath.gmachado’s answer (supposing it was formatted correctly).

decade_frequency = {}

for dec in decades:
    if dec not in decade_frequency:
        decade_frequency[dec] = 1
    else:
        decade_frequency[dec] += 1
1 Like

Thanks @masterryan.prof for testing this out. So it appears that if there is a problem, it is not with the DQ platform since you and I can both submit the code and it is accepted.

2 Likes

Lol… yeah not sure why sometimes there are issues on the learner’s side (might be on DQ’s too… we’ll never know)… weird. My advice would be to generally to wait for a few hours come back and try again and then thereafter submit a ticket as a last resort.

2 Likes

Hey @masterryan.prof

Thanks for the update. This just demonstrates how much, I am away from DQ. :frowning_face: :cry:

1 Like

Its fine lol I’ve been away here and there too haha… busy with school and work.