Answer:
import os
def create_python_script(filename):
comments = "# new python script file"
with open(filename,"w+") as file:
file.write(comments)
filesize = os.path.getsize(filename)
print(f"The size of the file is: {filesize}")
create_python_script("program.py")
Explanation:
The os module is a built-in python file that is used to interact with the operating system terminal. The with keyword is used to create and open a file with write privileges with no need to close the file.
The path.getsize() method is used to get the size of the newly created file which is printed in the console.
Answer:
The correct option is;
B. Managing change
Explanation:
Change management is a process of applying methods and instruments that bring about the implementation of required changes in an organization or project such that the changes are carried out in a seamless and timely manner using a carefully laid out and thorough approach that reduces the impact of the change on the quality of service and that handles the disruptions in the project or organization brought about by the change
<h2>Solution :</h2>
The given problem is solved in Python.
def ComputeSquare():
side = float(input('Enter the side of the square: '))
if side > 0:
perimeter = 4 * side
area = side * side
print('Perimeter of the square is:',
perimeter, 'unit.')
print('Area of the square is:', area, 'square unit.')
<h3> else:</h3>
print('Invalid input.')
ComputeSquare()
<h2>Explanation :-</h2>
- In this program, we create a function ComputeSquare() to calculate the perimeter and area of a square.
- The function asks the user to enter the side of the square. The side is then stored in a variable.
- Now, we check whether the side is greater than 0 or not using if-else statement.
- If the condition is true, the perimeter and area is calculated which is displayed using print() statement.
- If the condition is false, the else blocks executes printing the error message.
<h3>Refer to the attachment for output.</h3>
The common belief is that Closed Chain exercises are the preferred rehabilitation for anterior cruciate ligament (ACL) injury because of increased strain.