As there are no answers in the book to many of the questions. I wanted to ask if my thinking is correct.
It spews out an error because you cannot use a sub-variable to define a primary variable ? Sorry I’m just using my own words and not familiar with the programming lingo.
p/s Since there is no “data” assigned to it per se, so Python doesn’t know what to do with it ? But, it should have derived a value already by working down the lines ?
p/s 2 : Ok I just realized that passengers is missing a “s” …
p/s 3 : Wow, I just realized that the videos are like 10x more instructive than the book itself. What a gem.
I was working on this exercise today, that was the output
in the book is different , I looked for misspelling I could not see it.
Traceback (most recent call last):
File “ex4.py”, line 7, in
carpool_capacity = cars_driven * space_in_a_car
NameError: name ‘space_in_a_car’ is not defined
Hello, stan.
I’m pretty sure your code copied here would help.
It may not be “misspelled”, could be a space or syntax. Error may be on line 6, or 14 ect.
I found all of my misspellings in the exercise above.
I just want to make sure that I understand how variables work.
I can give a number any name that I can associate quick and easy with a certain operation I wanna do
? Just like in math x,y,x work in equation ?