GithubHelp home page GithubHelp logo

project4/step_3: "bill" not defined about pycar HOT 2 CLOSED

jtmx avatar jtmx commented on July 28, 2024
project4/step_3: "bill" not defined

from pycar.

Comments (2)

tommeagher avatar tommeagher commented on July 28, 2024

Jenny, sorry for the delay in responding to this. Are you saving this code in a script that you run from the command line, or are you typing them one line at a time in the interactive interpreter?
Either way, can you share your code in the lines before this? My guess is something got mistyped along the way. When I run this with python step_3_complete.py, everything works as expected.

But to your question on the "bill" variable: That's kind of an oddity of python that confused me initially. You don't need to declare that variable before you start your for loop. Using the for syntax indicates that you're about to loop through an iterator, and bill is a variable you create on the fly that refers to each item in the iterator (in this case, the objects list) each time you cycle through it. You could name it anything you want. You could call it sam or o or cheesesteak. The name doesn't really matter, provided you use that same name when referring to the individual objects in the lines that follow the for loop's start.

I hope that makes sense. Maybe @katiepark or @kevinschaul can explain it better. Either way, if you're still having trouble, share all your code in this thread, and we can help you debug it.

from pycar.

jtmx avatar jtmx commented on July 28, 2024

Thanks Tom. Your explanation helped.

Yup, you're right - just a typo on my part. Now everything works.

from pycar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.