1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Licemer1 [7]
2 years ago
6

The create_python_script function creates a new python script in the current working directory, adds the line of comments to it

declared by the 'comments' variable, and returns the size of the new file. Fill in the gaps to create a script called "program.py". 1- def create_python_script(filename): 2 comments = "# Start of a new Python program" with open("filename", "w+") as file: file.write(comments) import os filesize - os.path.getsize(filename) print("The size of the file is:") return(filesize) Reset 3 4 5 6 7 Run 9 10 11 print(create python script("progran.py"))
Computers and Technology
1 answer:
Vika [28.1K]2 years ago
6 0

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.

You might be interested in
The objects that you place on master pages are called _____.
Studentka2010 [4]
The answer to this is A.
3 0
3 years ago
In order to organize your work effectively on the computer, where is the best place to save it?
Morgarella [4.7K]
Your answer is -

B. Folder Is the best place to save it
8 0
3 years ago
Read 2 more answers
Which option can be used to access more settings than are available in the Backstage view?
Bumek [7]

Answer:

orientation settings

Explanation:

so u can now more about whta u doing

6 0
2 years ago
What are the main advantages of the d-step tuning of 2023 murano’s xtronic cvt®?.
DedPeter [7]

The main advantages of the d-step tuning of 2023 Murano's xtronic cvt is that:

  • It gives room for the transmission to quickly change ratios in regards to quick acceleration.
  • When at higher rpm, it help one to stepped acceleration via the use of linear acceleration feel.

<h3>What kind of transmission does a Nissan Murano have?</h3>

It is known to have a continuously variable automatic transmission (CVT) and it is one whose only engine is said to give about a 3.5-liter V-6 that helps to bring about a lot of power.

Note that the main advantages of the d-step tuning of 2023 Murano's xtronic cvt is that:

  • It gives room for the transmission to quickly change ratios in regards to quick acceleration.
  • When at higher rpm, it help one to stepped acceleration via the use of linear acceleration feel.

Learn more about cars from

brainly.com/question/25749514

#SPJ1

6 0
2 years ago
Create a class ProblemSolution with following characteristics Two private member variables name &amp; designation of string type
Romashka-Z-Leto [24]

Answer:

Please see the attachment for the solution

Explanation:

Download txt
4 0
3 years ago
Other questions:
  • In steps<br> Urgent please
    14·1 answer
  • A
    12·1 answer
  • Incident damage ____ is the rapid determination of the scope of the breach of the confidentiality, integrity, and availability o
    6·1 answer
  • Which ORDER BY clause causes 10 rows to be retrieved from the result set, starting with the 20th row?
    5·1 answer
  • Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full s
    12·1 answer
  • Match the elements of a web page with their descriptions?
    15·2 answers
  • Design the logic for a program that allows a user to enter 20 numbers, then displays each number and its difference from the num
    13·1 answer
  • You are developing a system to process lists of days of the week, represented as strings. Create a function is_weekend that cons
    12·1 answer
  • Why is manual coding the best way to learn HTML?
    11·1 answer
  • Hello,
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!