You are on page 1of 2

Name: Remedios Mae Busaing

BSIT 603

04 Hands on Activity 1
Part 1:
OUTPUT:

PART 2:

1. Variable names used and their categories (5 points)


• kinetic_energy: float, result of kinetic energy calculation
• mass: float, user input for the object's mass
• velocity: float, user input for the object's velocity

2. Special words used (5 points)


• def, used to define the function
• return, used to return the value calculated in the function
• float, used to convert user input to floating-point numbers
• input, used to prompt the user for input
3. Scoping rule used in the function (static or dynamic) and one-sentence explanation of why it falls
under that rule (5 points)
• Python implements a dynamic scoping rule. The variables declared in the main program (mass and
velocity) are accessible to the function kinetic_energy since they are defined in the same namespace
(global scope).

You might also like