Questions tagged [syntaxerror]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

What is the error in my code? (Finance)

I cannot seem to figure out what my problem is. Checked Line 81 several time (Yes I have made the table and all in the database). Even after removing the line, the syntax error shifts to Line 81. Only ...
0
votes
2answers
612 views

CS50 AI Problem 1A Invalid Syntax

For CS50AI Problem 1 (Knights), I am really confused as to what is producing this error. Code: from logic import * AKnight = Symbol("A is a Knight") AKnave = Symbol("A is a Knave") BKnight = ...
0
votes
1answer
21 views

CS50 2018 Lecture 1C. Unable to figure out syntax error in code

My code : #include <stdio.h> #include <cs50.h> int get_positive_int(string prompt); int main(void) { int i = get_positive_int("Positive interegr: "); printf("%i\n", i); } int ...
0
votes
1answer
178 views

Pset8 Finance problems with SQLite inserting into a table

Inserting into a table in finance.db fails. I'm able to run the sqlite3 command via cli without errors and populate the table with the debugging snippet command: INSERT INTO history (date, symbol, ...
0
votes
1answer
235 views

cs50 pset 1 greedy algorithm

#include <cs50.h> #include <stdio.h> #include <math.h> int main(void) { float y; do { y = get_float("Change: "); } while (y < 0); printf("%f\n", y * 100); ...
1
vote
1answer
231 views

pset 7 survey: trying to redirect to /sheet returns invalid syntax error

For part of CS50's survey problem from pset7, I'm supposed to redirect from a route that checks if the user has entered in all the survey's fields / appends the values to a csv file --> a route that ...
0
votes
1answer
63 views

Error on second line of code “int main(void)” while executing

#include <stdio.h> int main(void) { printf("hello , world"); } $ clang welcome.c $ ./welcome.c ./welcome.c: line 4: syntax error near unexpected token `(' ./welcome.c: line 4: `int main(...
0
votes
1answer
285 views

pset7- finance register invalid syntax error

I am just starting pset7 and I thought I had fully completed register, but I keep getting an invalid syntax error on this line: if not result: I am really confused as this is a really simple line ...
0
votes
1answer
267 views

PSET 6: Caesar.py - stuck on “SyntaxError: invalid syntax”

For my caesar implementation in Python, the CS50 IDE keeps telling me that I have a syntax error at the else portion of my for loop as shown below. Any help would be GREATLY appreciated! Haha, thanks ...
0
votes
2answers
22 views

Not a problem set, but a question about the “sizeof” example from week 1 walkthroughs

I've been trying to follow along with all the examples in the walkthrough and there's something that I can't get to work and I can't for the life of me figure out WHY I keep getting this error message....
0
votes
1answer
32 views

Error in my final project

So I am working on my final project and when I try to compile I get this error : mpg.c:169:1: error: expected '}' ^ mpg.c:133:2: note: to match this '{' { ^ mpg.c:169:1: error: expected '}' ^ mpg.c:...
0
votes
1answer
708 views

syntax error, unexpected 'for' T_FOR

I got this error syntax error, unexpected 'for' T_FOR for a function that uses a for loop. However, I can't point out what's the mistake. All the semicolons and variables are in place supposedly ...
0
votes
1answer
161 views

Syntax error: newline unexpected

I'm still working on the cs50 application (it's still 2015 right?) and got a problem with pset6. Basically I am getting a Syntax Error: /path/to/hello.html: 2: /path/to/hello.html: Syntax error: ...
0
votes
1answer
328 views

pset 8 mashup getJSON fails even though I am feeding it valid json

My google url shortener implementation as the "extra feature" has gone on for two weeks. I've struggled with this last little detail. Although I get a kick out of seeing most of the code function, the ...