The document discusses a code that uses the variable names mass and velocity to compute kinetic energy in a function. The function uses static scoping as it is based on the mass and speed passed into the function from where it is called. Special words like def, return, str and print are used in the function.
The document discusses a code that uses the variable names mass and velocity to compute kinetic energy in a function. The function uses static scoping as it is based on the mass and speed passed into the function from where it is called. Special words like def, return, str and print are used in the function.
The document discusses a code that uses the variable names mass and velocity to compute kinetic energy in a function. The function uses static scoping as it is based on the mass and speed passed into the function from where it is called. Special words like def, return, str and print are used in the function.
Variable names used and their categories (5 points)
• Variable names used is mass, velocity was used to compute kinetic energy.
2. Special words used (5 points)
• def • return • str • round • print 3. Scoping rule used in the function (static or dynamic) and one-sentence explanation of why it falls under that rule (5 points) • It has a static scope since it is based on the mass and speed of the item. By perusing the code, one may learn how to create codes more easily.