Is the problem that you have hardcoded the input file to "banned.txt"?
From the specification:
Accepts as its sole command-line argument the name (or path) of a
dictionary of banned words (i.e., text file).
Opens and reads from that file the list of words stored therein, one
per line, and stores each in a Python data structure for later access.
The errors give a very good clue to the problem. Program is "case sensitive" and must be "case insensitive". Perhaps investigate how you can use strcasecmp (as Zamyla mentions in the check walkthrough). From the man page [emphasis added]:
The strcasecmp() function compares the two strings s1 and s2, ignoring the case of the characters. It returns an ...
Not exactly clear what you're asking in your first question, but I know what you should be asking, so here goes. ;-)
The file can't simply be multiplied by some scaling factor. Each line of pixels (excluding the padding) needs to be scaled up. Then, the appropriate number of bytes need to be added to the end of the scaled up line.
That last part explains ...
To answer your first question, check50 is not available in the Lab. (check50 is not introduced until Week 3 when you will move to the IDE).
To answer your second question, you are only seeing a score for Scratch because that was submitted in 2018. Your other programs were submitted in 2019, but you used the 2018/x submit50 code.
You'll need to ...
I tried running your code in the sandbox, resulting in an additional row without any hashes on top of the pyramid (you can see the space between the pyramid and the height prompt). To solve the problem, the first for loop should have i starting at 1 if you're using <=.
for (int i = 1; i <= n; i++)
Additionally, your second line of hashes have three ...
I won’t be able to finish the course before 31 December 2019. What will happen?
After 31 December 2019, the course will be updated to a 2020 version. Your progress from 2019 will be carried forward to the 2020 version. After 31 December 2019, ...
Yes, your progress from 2019 will carry forward to the 2020 course, but you'll need to complete the course using the 2020 materials. We'll publish transition instructions in January (much like the big yellow box on the front page of the current 2019x course.)
I don't think it's a good idea to add listeners in a callback that way. They can pile up. The empty form does not seem to have one, empty form would submit, and you have no code for removing them later. The problem specification does not even mention key presses, and you could fill the form without a single one (e.g. autocomplete or copy/paste via mouse).
Can't speak to the user error because I'm not well versed in flask, other than to say that an unused variable is pretty much self-explanatory. But, hopefully, this explanation will make the whole thing moot.
As a general security rule, table manipulation at an app level should be completely avoided!
Creating a new table for each user transaction, or even ...
Your answers is going to be a list of each list of answers (ie, a list of rows). The actual 'title' of those answers isn't in the file.
You only need to iterate over each line and then iterate over each item (in the comma separated list).
Let's say that someone filled out your form and chose "me, 1, sports, my reasons" for the 4 questions. The next ...
You can check your own style by running style50 mario.c
You can see the tests used for grading by clicking the check50 button next to your submission on cs50.me/submissions
With both of those tools, you should be able to figure out where you've gone wrong.
The errors are self explanatory.
The code accepts 0 as a valid input, it should reject it.
In all the pyramids that the code prints, the first line has two #'s. There should be only one.
Is it possible that you're working with last year's pset website? It changed this year.
If this answers your question, please click on the check mark to accept. ...
Cut and paste error. What is the value of a dime? A nickel? A penny? I'm sure it isn't 25 cents each!
When you get to the point that you're not seeing the forest for the trees, as is the case here, it's always best to take a break and set it aside for at least a couple hours, and not think about it at all. Better to let it sit overnight!
You assign the height to variable i, and on the next line you overwrite it with 0, throwing away the user input. Make the row counter a different variable, and name your variables according to their meaning, especially if they are used at any point outside of the loop head, and both height and likely also the row counter (or whatever you want to call it) are....
Firstly, the method split returns a list; and as per the line inputList = [input.split()] your're enclosing the returned list within another which yields the nested list.
Secondly, you might want to consider revising the line s = line.splitlines() as the method splitlines breaks the string at line boundaries (i.e. \n) which might not what you intended since ...
So you decided to make some functions, why not. The function definition would be like
return_type function_name(param1_type param1_name, param2_type param2_name, ...)
// body of the function
// function apply_discount takes two parameters of type double
// and returns a double itself
double apply_discount(double price, double ...
This is the proper way from the pset page
but we are now in 2019
Caeser Pset Page
In the picture it shows that you just submitted the pset in 2019 which wont submit
Since CS50 intsructed students this way
Hello, world! This is CS50x 2019.
New to CS50? Scroll down ...
In that Words example:
The Python code in application.py uses a jsonify function to return a list as a JSON object:
q = request.args.get("q")
words = [word for ...
The block of code that needs to be changed is as mentioned below after the line 15:
save the file name from the command line argument into a variable called banned_text
banned_text = argv
use the variable name in the below file open command
with open(banned_text, "r") as f:
With rest of the code as it is, program works absolutely fine:)
Have a look at your gradebook. I would expect that you don't have grades for Resize, Recover (both pset3 this year), Homepage (pset5) and the final project.
Is that what you are seeing? You will need to complete those.
custInt *b = a -> cI;
b = malloc(sizeof(custInt));
First line initialises b to a -> cI. Second line discards that value to replace it with the address returned by malloc. To assign to both, you could do
b = a -> cI = malloc(sizeof(custInt));
= assignment expression has the value that's assigned, and is evaluated right to ...
You're right, there are some substantial changes for 2019. A lot of the first half of the course content has been compressed into less time and some has been removed. However, the latter half of the course has now been expanded and more material added.
To complete the course, you need to continue with the 2019 version. You already have credit for the work ...