Comments (5)
Hi! Thanks for your issue. I just checked my code I think the problem is because of the line:
previous_score = score0
or previous_score = score1
. The previous_score
is updated every time I call say
. Therefore, if you call the function for the second time, there would be no print messages. If I remembered it correctly, my code passed all the test cases back to the course of 2017 Fall. So maybe they have changed the rule. Thanks again for your report anyway!
from cs61a.
Thanks! I take the version of 2018 Spring and they might add more tests.
from cs61a.
Hi @czahie , it is very nice for sharing the notes with us. I have a quick question, where do we get the OK
credential if not enrolled in Berkeley, how do you pass all tests if without OK
? I read cs61 account trouble shooting, but still confused about their autograder system.
Thank you so much!
from cs61a.
@pangjac Actually, I used ok
. I think there's a way to use ok
locally, meaning that you can use ok
without a Berkeley email. But I'm not sure whether they've updated this or not.
from cs61a.
Hi! Thanks for your issue. I just checked my code I think the problem is because of the line:
previous_score = score0
orprevious_score = score1
. Theprevious_score
is updated every time I callsay
. Therefore, if you call the function for the second time, there would be no print messages. If I remembered it correctly, my code passed all the test cases back to the course of 2017 Fall. So maybe they have changed the rule. Thanks again for your report anyway!
Thanks!
I don't fully understand the command "nonlocal", but I believe it causes the problem that the function gives a different result when later called.
@Mike-Dai 's solution also makes it unnecessary to use the "nonlocal" command.
I think it is what the instruction means: "1) Rather than reassigning [var] to its new value, create a new variable to hold that new value. Use that new variable in future calculations."
Thank you both! Now I understand much better about this problem.
BTW, potentially "previous_high" is another headache, with similar two issues.
from cs61a.
Related Issues (2)
- So much bug in hug item! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cs61a.