Hi everyone, I’m a beginner at Python and taking an online course. I submitted a task like below but the system always said it was wrong. Would anyone help me to check what is wrong? I checked 3 times but I still have no clue… so frustrated
Please post code as text inline instead of as a screenshot. Likewise
with any program output. There’s a </> button in the compose bar to
help with this.
The question’s a little loosely worded. The final task says: “If the age
is valid, negate the variable can-drive and assign the result to a new
variable cannot_drive.” That does seem to be nearly what you’ve done.
However I expect they mean to negate can_drive itself so that it is no
longer False. Then as a separate step, regardless of whether can_drive is true or false, I’d define cannot_drive as you have: to
always be not can_drive.
Have a think about how you’d do that - your code is very close.
It’s REALLY loosely worded, but yeah, I’d be thinking the same as you are. Which results in a weird set of variables at the end. But, if that’s what the instructor’s looking for, so be it.
I think there’s no error, you’re doing exactly what the instruction says, and your code is valid. It’s either the instruction is unclear, or their test code is faulty.
I’d just move on to the next question, if I were you.
Did you solve this? I’m running into the exact same issue with this problem. I’ve tried different logic, and just flat setting the variables to specific bools but it says it’s wrong no matter what I do. I’ve checked both the variables are showing up as bools. I am beyond frustrated. Please let me know if you found a solution.
I don’t know what the answer is. I created three different stetups and they all said the same thing. I finaly copied the professor and it was still wrong.
can_drive = False
age = 20