Hot answers tagged

2 votes
Accepted

PSET6 Similarities (More) 500 Internal Server Error

except for the first element, which is supposed to have no operation, but I gave it an Operation.SUBSTITUTED And this is probably the problem, since that operation subtracts 1 from i and j, which ...
user avatar
  • 18.4k
2 votes
Accepted

Problem Set 1 help, clang hello.c, and ls (list)

Ahh I figured it out! Instead of using ~/pset1/hello/ $ go back to just the directory pset by using change directory ~/pset1/hello/ $ cd ~/pset1/ then add your ls command ~/pset1/ $ ls hello/ ...
user avatar
1 vote
Accepted

CS50_Web ORMs,APIs_ lecture 4, classes4.py - Understanding Classes, Objects, Functions and Lists

passengers is a list of Passenger objects, therefore print(self.passengers) is printing a list of Passenger objects. This print(self.passengers.flight_id) would fail because self.passengers is a list ...
user avatar
1 vote

How to display python list in index.html ? finance - index.html

Solution {% for stock in stocks %} <tr> <td> {{ stock.symbol }} </td> <td> {{ stock.name }} </td> <td> {{ stock....
user avatar
1 vote
Accepted

pset7: why do we need [0] in from of list? (e.g. someData[0]['dic']?)

It's because when you run an SQL query with execute(), all the affected records in the database are returned to you, in an array of dictionaries. So you want the first dictionary in that list. But if ...
user avatar
  • 7,326
1 vote

CS50 commands, standard commands - is there any literature and who did that?

Some of the "Shorts" in Week 0 and Week 1 dip a little into this (not much!) but they do provide a little insight into where you can go and do further research to find out the answers you may be ...
user avatar
1 vote

confused by search function in Week 7 "lecture, continued"

I am confused as to why these are both called n. As a result, the line of the search function Why are they both n? Well, they could have been called anything he wanted. This was just for ...
user avatar
  • 17.4k
1 vote

confused by search function in Week 7 "lecture, continued"

It's common to use the variable n when we are talking about numbers. That example also help you to realize that even when those data are receiving the same variable name, they won't collide because ...
user avatar

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