Tutor profile: Sadhana S.
Subject: Python Programming
What is a "NameError" in Python? How should it be tackled?
Consider this: Martin can only remember meeting someone if he knows their names. If he can't remember their names, he forgets everything he knows about them. Martin meets Mira but doesn't register her name. Which means that the next time Mira shows up, Martin will not be able to recall anything about her. Python is exactly like Martin. If something is not defined (not given a name), Python will not recall anything and will return a NameError. This can be tackled by mindfully defining all the variables and tracking down which variable is not defined. Clearing a variable name when it's not useful anymore is a programmer's way to keep their work clean.
What do you find when you integrate f(x) = x between x=a and x=b?
The area under the graph of f(x) = x between x=a and x=b. Imagine the area under the graph of f(x) (for all positive values of x), being made up of rectangles of width dx (difference in x(n) and (xn+1) ) and height f(x) (corresponding y value). While Integrating the graph of f(x), we simply add up the areas of infinitely many such rectangles between x=a and x=b.
Is my car accelerating if it is moving with a constant speed in circles?
We often define acceleration as the change in velocity of a mass with respect to time. Formula says acceleration = dv/dt (change in *velocity*/ change in time). Alright, if I consider an object moving in a straight line, its *speed* changing constantly with time, the the object has constant acceleration. Fine, but what about an object moving in circles with a constant *speed*? Yes, it is still accelerating. It is very important to distinguish between *speed* and *velocity* while exploring the concept of acceleration. Speed: How fast an object is moving (irrespective of the direction) Velocity: How fast an object is moving and in what direction. Now let's go back the formula, a= dv/dt When my car is moving in circles, even though it has a constant speed, it is constant changing direction and hence constantly changing velocity with respect to time. Hence, it is constantly accelerating.
needs and Sadhana will reply soon.