Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 10074
0 votes

Pset7 houses - why does my output prints thrice instead of once?

Each record is in the database multiple times. Possible causes: import is run multiple times there is a bug in import which inserts multiple rows for each line in the csv. The data needs to be del …
DinoCoderSaurus's user avatar
1 vote
Accepted

Reason for error pset7 houses

Assume error comes at if (len(lis) == 2): (there are two "len" in the program). The problem is here lis = row["name"].split, because it is not calling the split function. It is declaring lis a functi …
DinoCoderSaurus's user avatar
3 votes
Accepted

pset7 Houses get 17% submit

The pset requires a table names students (plural). That is how the distro database is configured. It looks like this program is looking for a table named student singular, based on this INSERT INTO st …
DinoCoderSaurus's user avatar
1 vote

Houses ~ Import.py - Nothing being inserted into students.db

Since program uses the sqlite3 python interface (not the CS50 SQL interface), any changes to the database need to be committed in order to persist. From the python sqlite interface doc: commit() …
DinoCoderSaurus's user avatar
1 vote
Accepted

Why updating a dictionary is not working?

Maybe a typo? == is not the set operator, it is the relational operator. This row['middle'] == "" evaluates to False; it does not change the value of row['middle'].
DinoCoderSaurus's user avatar
0 votes

pset7 - Houses problem with check50

This db.execute("INSERT INTO students VALUES (?, ?, ?, ?, ?)", vals) will give an error when the students table has the schema from the distro students.db. The distro students table has 6 columns, thi …
DinoCoderSaurus's user avatar
1 vote
Accepted

PSET 7 HOUSES - Syntax error on case function

The CASE is the fourth column in the select, so it needs a , after birth. That will fix the syntax error. It may not, however, give you the result you are looking for :) The number of columns returned …
DinoCoderSaurus's user avatar
1 vote
Accepted

Pset 7 Houses: Import seems to work but check50 doesn´t agree

This with open("characters.csv", "r") is a problem. Why take an argument and not use it? Don't hard code the file name.
DinoCoderSaurus's user avatar
1 vote
Accepted

pset7 houses: dict to SQL

executemany is included in the python sqlite3 library, but not in the cs50 SQL library. One option would be to iterate over the dict and insert one row at a time.
DinoCoderSaurus's user avatar