Questions tagged [pset9]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

Check50 says buy allows fractional, negative numbers but it doesn't. Where am I going wrong?

I'm down to my last check50 frown (:( buy handles fractional, negative, and non-numeric shares expected status code 400, but got 200) but my code doesn't allow for these, so I don't know what to do. ...
0
votes
1answer
13 views

jinja code not working inside html file

I am using flask for the first time and jinja code is being displayed on the webpage. this is my html file: <!DOCTYPE html> <html lang="en"> <head> ...
0
votes
1answer
23 views

Why does my lookup function keep returning "None"?

I have the latest (I think) distribution code and I have exported the API key. Here is my code and it keeps returning 'None'. I can't figure out why I can't look up a stock quote. Do I need to change ...
0
votes
0answers
10 views

How do I get an API key from IEX?

I've just started on pset9 finance, but I can't create an account with IEX. When I try, it tells me that my email address is already in use (this is definitely not true - I'm using a relatively new ...
0
votes
1answer
28 views

PSET9 / can't check until a frown turns upside down

I am getting this message in the following checks :| sell page has all required elements/ :| sell handles invalid number of shares :| sell handles valid sale I guess the problem is in by sell or buy ...
0
votes
0answers
25 views

Pset9 problem at check50 tests

hello, i've tried "112.00" in my solution and cs50's solution and the result is same "invalid shares" but i don't know why this error occur. i'm really stuck any help please
0
votes
1answer
23 views

pset9: finance // jinja syntax error in index

I'm working on my index page and I have two errors. For the first, I'm not sure what's wrong. It seems like it's something with my return statement but I have no idea what's wrong with it. File "...
0
votes
1answer
23 views

I'm on pset9 right now and I'm running check50 on my code and getting :( logging in as registered user succeeds expected status code 200, but got 403

I've tried everything that I thought could be the problem but nothing is working. I registered and tried logging in but I keep getting '403 Invalid username and/or password' error This is my login ...
0
votes
0answers
17 views

Pset Finance - issue with usd

I'm stuck with pset9 Finance... When I try to sell a quote and return to index.html, I have an error with : File "/home/ubuntu/pset9/finance/templates/index.html", line 1, in top-level ...
0
votes
1answer
37 views

check50 errors for "buy" and "sell"

I get below errors from check50: :( buy handles invalid ticker symbol application raised an exception (see the log for more details) :( buy handles fractional, negative, and non-numeric shares ...
0
votes
1answer
30 views

What mistake am I doing in the below "buy" and "sell" code.? I get the below errors from check50

I get the below error from check50: :( buy handles invalid ticker symbol application raised an exception (see the log for more details) :( buy handles fractional, negative, and non-numeric shares ...
0
votes
1answer
48 views

Pset 9 Finance index function, current stock price not displaying correctly

I am working on getting the proper information to display on the index page. I have one piece left, and it is displaying the current value of the stock. When I look at my output for my 'user' and '...
0
votes
0answers
19 views

My "register" function in pset9 is not working

What mistake am I doing in the code below for pset9 "register" function: @app.route("/register", methods=["GET", "POST"]) def register(): """...
0
votes
1answer
36 views

Buy/Sell on Index - button attributes & form value issues

I've got a couple issues adding my own buy/sell buttons to the index page. First, each "Buy" or "Sell" buttons opens up the form for all of the table rows. How can I modify these ...
0
votes
0answers
126 views

Pset 9 finance-Problems for type= number output on the webpage

I am working on a CS50 task called "finance". The problem is that I get an error when I want to check the integer value of the share amount and put it on a separate template for checking my ...
0
votes
1answer
39 views

check50 on finance pset

I'm having 2 problemas with my check50: :( buy handles fractional, negative, and non-numeric shares :( sell handles invalid number of shares As shown in the code below, my input in buy and sell is ...
0
votes
1answer
36 views

Buy Finance Pset9 Cash not working

I am working on pset9 finance and I have been stuck for a while on it, especially this part: cash = db.execute("SELECT cash FROM users WHERE user_id = :userid", userid= ...
0
votes
1answer
43 views

PS9 Finance - Check50 - :( buy handles valid purchase

I am running into an issue with check50 on my buy function. Check50 gives me the following error: :( buy handles valid purchase Cause application raised an exception (see the log for more details) ...
0
votes
1answer
41 views

Pset9 Finance Sell select menu

I'm doing the "sell" part of the Finance pset. I am trying to display the stocks someone is able to sell on a HTML page with a select menu. The problem is that they don't display properly on ...
0
votes
0answers
16 views

Index route_TypeError: 'NoneType' object is not subscriptable

I tried to run the program and encountered this error: My code: @app.route("/") @login_required def index(): """Show portfolio of stocks""" # Selecting ...
0
votes
1answer
26 views

Pset9 Finance - How do I load the symbol into my input box on the Buy.html?

I am successfully getting the symbol from the button (as see in image) but I am not sure how load it into the text field as value to be submitted. Please help.... @app.route("/buy", ...
0
votes
1answer
24 views

How to access the values returned by SELECT SUM

I am trying to create the table in pset9 finance to display what stocks the user has. My current attempt tries to do this by summing up the number of stocks in past transactions the user has made. I ...
0
votes
0answers
18 views

database schema for finance PSET9

Just wondering what the best database design is for this particular pset. ATM I have a table for trades which serves to record all transacsatsions (buy and sell), each trade has an unique id, and ...
0
votes
1answer
22 views

Why is the portfolio not being displayed? I get not errors but nothing is being displayed. I am at a loss as to why I cannot display any stocks

@app.route("/") @login_required def index(): """Show portfolio of stocks""" rows = db.execute("SELECT symbol, SUM(shares) as Total_shares FROM ...
0
votes
0answers
59 views

C$50 Finance: ":( sell handles valid sale expected to find "56.00" in page, but it wasn't found"

Check50 does not seem to think that the values in my table in index.html are updating correctly. After an afternoon of testing and searching through here and stackoverflow for similar issues, I cannot ...
0
votes
1answer
91 views

PSET 9 Quote function not working correctly

Lookup function always returns "None". Weirdly the same code produced correct results yesterday but as of today it stopped. Any thoughts why? The code for the quoted.html and application.py ...
0
votes
0answers
76 views

Pset9 Finance| "Index table" doesn't display all the companies

I'm doing pset9 "Finance" and I've designed the two tables in the database, one with purchases and the other with transactions. Now when I render the index page, the shares of only one ...
0
votes
1answer
48 views

Runtime Error Unsupported Value in pset9 Finance

I'm doing Pset09 "Finance" and I have been stuck in the "index" function for quite a while. I tried to use the already existing "trans" table but I am getting an error. ...
0
votes
0answers
13 views

pset9 finance // expected to find "112.00" in page, but it wasn't found [duplicate]

Hi I was testing out my code for the buy function to buy a stock but once I tried to buy a stock it gave me this error: expected to find "112.00" in page, but it wasn't found and I am not ...
0
votes
1answer
118 views

pset9 buy function // buy handles invalid ticker symbol and handles valid purchase having error

I ran check50 to check some things that were wrong and I got 2 errors but when i check the details of the error it doesnt really give me a detailed overview of the problem so I am not really sure how ...
0
votes
0answers
35 views

PSET 9Help with SyntaxError: invalid syntax error

The SyntaxError: invalid syntax error points me to line 75, but I cant see what is wrong there. Please I need help to identify possible reason. When i run Flask, the server crashes. 192.168.1.172 -...
0
votes
1answer
93 views

CS50 Finance check50 problem in sell function, it works fine when i test it as well but idk what the problem is

I tried my solution multiple times and compared it to the staff's solution as well but there is an check 50 error saying ":( sell handles valid sale expected to find "56.00" in page, ...
0
votes
2answers
54 views

What is the difference between Finance in 2020 and 2021

Please I want to ask What is the difference between Finance in 2020 and 2021. I have tried the problem set in 2020, I want to know as it might help em know how to proceed.
0
votes
1answer
58 views

pset9 finance // index function doesnt display the sum of the shares

I am doing pset9 finance and I am kind of stuck because whenever I buy for example FB stocks multiple times it doesn't sum up in to show in the index function. this is the code: @app.route("/&...
0
votes
1answer
36 views

pset9 finance // how can I check whether someone has registered

I ran a check50 and i found that its not checking if the user is in the database when registering so i decided to put a if statement which checks if the user is not added but it gives an error and i ...
0
votes
1answer
58 views

pset9 // register function not registering user

I am having this problem with my register function in pset9 when i register on the web app it says error 500 internal server error and when i check my terminal it says: return self.view_functions[rule....
0
votes
1answer
363 views

pset9 Finance "jinja2.exceptions.TemplateSyntaxError: expected name or number" error

In my index function, every time I try "flask run" it outputs that error (jinja2.exceptions.TemplateSyntaxError: expected name or number). Everywhere I've checked most people have been ...
0
votes
1answer
110 views

pset9 Finance - " RuntimeError: unsupported value: " error

(1) "buy" code in application.py: @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): if request.method == "GET": ...
0
votes
0answers
97 views

PSet9 Finance: Check50 register function exception - 'NoneType' object not subscriptable

I recently completed Pset9 (everything seems to be running fine on the local server) and decided to run a check50 before submitting. However, Check50 marked two issues in my register function: "...
0
votes
1answer
76 views

pset 9 Finance can't register or check for duplicates TemplateSyntaxError

I'm passing all register checks except for: :( registering user succeeds :( registration rejects duplicate username I've checked other answers and I've re-written the code a few times but I can't ...
0
votes
0answers
121 views

What's wrong with my register function? (Pset9 - Finance)

Here's my register function in application.py: @app.route("/register", methods=["GET", "POST"]) def register(): """Register user""" ...
0
votes
2answers
125 views

PSET9 Finance: Check50 says Buy doesn't handle fractional/invalid shares, but when I try these things my page does reject them. Why check50 no like?

I have been using some of the html from the cs50 finance example page: https://finance.cs50.net/buy (which is permitted by CS50) I think it may be at the root of the problem. Here's the relevant html ...
0
votes
1answer
24 views

For finance, does anyone know why my page for selling stocks does not work?

Here is my python code. @app.route("/sell", methods=["GET", "POST"]) @login_required def sell(): """Sell shares of stock""" if ...
0
votes
1answer
33 views

For finance, does anyone know why my page to buy stocks does not work?

Here is my python code @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request....