6 votes
Accepted

pset7- finance register invalid syntax error

When an obviously correct line gives a syntax error, look to the preceding line. Are there enough ')' on the db.execute?
2 votes
Accepted

syntax error, unexpected 'for' T_FOR

Not all of them! $alphacount = 0 :)
1 vote

CS50 AI Problem 1A Invalid Syntax

You have to provide commas to keep separate your logical expressions like And(Or(AKnight, AKnave), Biconditional(AKnight, Not(AKnave)), Biconditional(AKnave, Not(AKnight)), Implication(...
1 vote
Accepted

Pset8 Finance problems with SQLite inserting into a table

This datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') is not valid sqlite syntax. You can simply use datetime('now'). It will return the current datetime in YYYY-MM-DD HH:MM:SS format. Try SELECT ...
1 vote

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

The code posted above compiled without error for me. Is it possible that you didn't cut and paste the original code from your development environment exactly as it appears? Errors like this usually ...
  • 64.6k
1 vote
Accepted

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

It is as easy as replacing else with elif, in python a condition is not allowed after an else, remember that else is executed if the if condition is not fulfilled, if we want to impose a new condition ...
  • 5,181
1 vote
Accepted

Error in my final project

It's exactly what it says, a straight up missing closing curly brace. Try counting them for yourself. Starting with the beginning of the bitnumber() function at line 96, start counting +1 for each { ...
  • 64.6k

Only top scored, non community-wiki answers of a minimum length are eligible