September 19, 2024
CS50 Finance | CS 50 Week 9 Problem Set Finance UPDATE | Beginners Guide to PSET 9 2024
 #Finance

CS50 Finance | CS 50 Week 9 Problem Set Finance UPDATE | Beginners Guide to PSET 9 2024 #Finance


foreign welcome back hopefully we’re going to keep this a short CashNews.co I’ve had quite a few requests to update Finance week 9 since this roll out here now despite me

answering some of these comments it seems like there are people that believe the code doesn’t work so real quick the first thing we’re going to do since it’s been tested is without changing the code at all we’re going to go ahead and run our check

href="https://cashnews.co/finance" style="font-weight: bold; color: #1a73e8; text-decoration: none;">Finance because the code that’s in the CashNews.co is still an adequate code to solve this problem but then we’re going to go over on what the changes are so if you take a look at

the terminal here we just ran check 50. I’ll move this terminal up and as you can see it handles all the functions that are requested this would be absolutely acceptable to churn in the code from the previous CashNews.co does work the changes are just for helpers.py and app.py which are

probably not going to be of much consequence anyways but let’s take a look so here’s our original code for helpers.py not a very long one I’m going to copy what’s in here and paste it off screen over here and then we’re going to do what cs50 says we’re going to

remove helpers clear our terminal removehelpers.py the answer is yes and we’re going to reinstall helpers.py now we’ll grab that file clear our terminal and again just to check to make sure everything works we’re going to go ahead and run a Check 50 again and while check 50 is

running let’s see if we can identify any changes in the helpers file so it Imports a few different things here date time pytz request sub process redirect the apology message here all right so since you can see that it handles everything still perfectly despite the new helpers.py file looking

at the file it looks like the big change is that they want to use the Yahoo API so instead of making you enroll for that API key that was limited to 30 days it looks like this one’s importing from Yahoo so so take a look here and make sure that’s accurate does look like that’s

going to be the biggest change so this particular function right here where it’s getting the API key from Yahoo basically now you don’t need that specialized key to log into that website to get the buy and sell commands for the price of the stocks that you’re buying and selling

let’s go over to our app.py we’re going to copy all of this over off screen here and now we’re going to do the second portion here we’re going to remove app.py you should see all of that disappear in a second yes and we’re going to W get the new app.py file see what

changes have occurred pop into rpy no changes at the top no changes for helpers no changes for flask for ginger session type is the same library is the same difference is here make sure your API key is set which we had to have on the old one and we don’t have to have on the new one and then

we have the after request which is the same the route for login is all the same all right so the only thing that changes exactly what I thought they don’t have an API key anymore now it’s important to note that the CashNews.co that you watched if you’re on this CashNews.co because

you think it doesn’t work it does that CashNews.co teaches you how to solve this with an API key and still solves all the problems to Green because when they do the check they’re not actually using an API key they’re not renewing a key every 30 days so they have these kind of set

things however I’m going to put in all of the original items from the first CashNews.co here in each of the login the buy the cell I’m going to re-put all those in right here and then I’m going to run the check and we’ll check it again all right team that’s all been

input the login and logout function were still the same as predicted they no longer are asking you to get an API key I plugged in all of the original code for all of my original purposes so we have buy we have cell we have history we have the register function so everything that’s in here is

the same from the original code from the original CashNews.co now that we have all that back in here without changing anything that was provided which was the top portion the login and the logout function we’re going to run our check 50 here and as you can see everything still works the

CashNews.co that’s up there is the Right CashNews.co if you’re getting errors there are errors in the code this update only changed to helpers.py and app.py just to remove the necessity of the API key which is exactly what I thought because I’m sure a lot of users are running into

registration functions or thinking that their API key ran out and they couldn’t complete it this code works the CashNews.co is correct even with the June 1 update everything that’s in there is right all you have to do is follow it precisely if you’re not doing that I promise you

it’s a tab error there’s a comma error there’s a semicolon error the CashNews.co is right this is the same code from before with the update the new helpers.py the new app.py everything’s good stay on track stay focused it’s not easy because it has to be meticulous and

there cannot be errors in the code this is your update for June 1 for week 9 Finance this is cs50 that was text-decoration: none;">Finance I am Devin as always you’re awesome keep the comments and questions coming and in this case there were no changes despite the update so that CashNews.co still works just fine to solve the code look forward to seeing you soon

Now that you’re fully informed, watch this insightful video on CS50 Finance | CS 50 Week 9 Problem Set Finance UPDATE | Beginners Guide to PSET 9 2024.
With over 15150 views, this video is a must-watch for anyone interested in Finance.

CashNews, your go-to portal for financial news and insights.

25 thoughts on “CS50 Finance | CS 50 Week 9 Problem Set Finance UPDATE | Beginners Guide to PSET 9 2024 #Finance

  1. but what about those using 2024 version, I followed your long video about finance , but the code didn't work for me. I don;t know the reason 🙁 please, get back to me if you can, appreciate it!

  2. Yo devin! I've been following your code here, but I keep encountering an error:

    🙁 quote handles invalid ticker symbol

    expected status code 400, but got 404

    and

    🙁 quote handles valid ticker symbol

    application raised an exception (see the log for more details)

    🙁 buy page has all required elements

    expected button to submit form, but none was found

    Where am i going wrong???

  3. Hi Devin! Why do I keep getting these :
    🙁 registering user succeeds and portfolio page is displayed

    application raised an exception (see the log for more details)

    🙁 registration rejects duplicate username

    application raised an exception (see the log for more details)

  4. I still get an error and idk why. in the buy section it tells me "TypeError: can't multiply sequence by non-int of type 'float'" and IDK why it drives me crazy. ive done everything the same as you

  5. Hi! How are your?
    I'm really grateful for your videos and they helped me lot but can you help me with this same pset. my code ismost probably correct cause its the same as yours but why do I keep getting "Can't check until a frown turns upside down" do you know anything related to this? My deadline is tomorrow I'd really appreciate it if you replied early!

  6. 4:43, what is the line u used for the sell shares function?what i have is
    stocks = db.execute("SELECT symbol, SUM(shares) as total_shares FROM transactions WHERE user_id: user_id GROUP"

    user_id=session["user_id"])

  7. Hi Devin, I was able to do the majority but now I have this error (see below) Can you or anyone help me please I've been trying to do this lesson for a long time now I am giving up

    Results for cs50/problems/2023/x/finance generated by check50 v3.3.9
    🙂 app.py exists
    🙂 application starts up
    🙂 register page has all required elements
    🙂 registering user succeeds
    🙂 registration with an empty field fails
    🙂 registration with password mismatch fails
    🙂 registration rejects duplicate username
    🙂 login page has all required elements
    🙂 logging in as registered user succceeds
    🙂 quote page has all required elements
    🙂 quote handles invalid ticker symbol
    🙂 quote handles blank ticker symbol
    🙂 quote handles valid ticker symbol
    🙂 buy page has all required elements
    🙂 buy handles invalid ticker symbol
    🙂 buy handles fractional, negative, and non-numeric shares
    🙁 buy handles valid purchase
    expected to find "9,888.00" in page, but it wasn't found
    😐 sell page has all required elements
    can't check until a frown turns upside down
    😐 sell handles invalid number of shares
    can't check until a frown turns upside down
    😐 sell handles valid sale
    can't check until a frown turns upside down

  8. Hey, I’m really confused. I did everything in both videos and copied the code, but the screen after logging/registering in isn’t popping up. It just redirects to the original log in/registering screen. I can’t get logged in and when I try, I get the apology message.

  9. Hi Devin. Thanks so much for this video. I learned so much from following along with you. I was able to clean up my code and get rid of a lot of unnecessary things. I like how your code is quite clean and tidy. I was then able to add in other things like change password, add and deposit funds and even a transaction log for deposits and withdrawals. best of all, after all that it still passed cs50s check. Thanks again.

  10. Hey Devin, i keep facing the issues 🙁 registration rejects duplicate username and 🙁 registering user succeeds with the log saying 
    "sending POST request to /register
    exception raised in application: RuntimeError: unused values (user_id)."

    Any idea how to solve this? Thanks!

  11. Hello,
    I've been trying to solve the CS50x problem since a month but I am still unable to. The only set left is this one. Is there any correct solution form where I can copy the code and learn from it. I'm really tired now.

  12. Hello brother, I am having an error in my code in which is:

    🙁 buy handles valid purchase expected to find "9,888.00" in page, but it wasn't found

    I hope you can help me.

Leave a Reply

Your email address will not be published. Required fields are marked *