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]
3 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]3 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
Write a basic notation for
Licemer1 [7]

Answer:

a = (b + c)/(2 * c)

z = x/(y + c)

c = (9 * c + 32)/5

Explanation:

Required

The expression in basic

To do this, we use () to group items, / as divide and * to combine factors

So, we have:

(a)\ a = \frac{(b + d)}{2c}

In basic, it is:

a = (b + c)/(2 * c)

(b)\ z = \frac{x}{y + c}

In basic, it is:

z = x/(y + c)

(c)\ c = \frac{9c + 32}{5}

c = (9 * c + 32)/5

4 0
3 years ago
How does lower latency benefit the users connected to a network?
storchak [24]

Answer: Low latency in network connection refers to a minimal delay in processing computer data over the connection. Lower latency in the network provides closer real-time access with minimal delay times. High latency occurs when it takes longer for a packet of data to be sent to a physical destination.

Explanation:

3 0
3 years ago
Anyone play Ro-blox ? without the -
Olin [163]
I do! I know it says high school but I lied :)
6 0
3 years ago
Read 2 more answers
A block style business letter is:
julia-pushkina [17]

the answer is A typewritten form of communication with all parts aligned to the left margin

3 0
4 years ago
A technician is installing RG6 cable and asks you to retrieve a connector from the parts drawer. What type of connector do you n
Bezzdna [24]

The type of connector, which is needed when a technician is installing RG6 cable and asks to retrieve a connector from the parts drawer, is F-connector.

<h3>What is F-connector?</h3>

The F-connector is a type of RF connector which is used to connect the Video equipments to the antennas and setup box.

A technician is installing RG6 cable.

  • The RG6 cable is a coax cable.
  • This cable is used in satellite signal transmission, generally for TV and setup box.

Now the technician is ask to retrieve a connector from the parts drawer. Here, we use F type connector for this RG6 cable.

Thus, the type of connector, which is needed when a technician is installing RG6 cable and asks to retrieve a connector from the parts drawer, is F-connector.

Learn more about the connector cable here

brainly.com/question/9082842

#SPJ1

4 0
2 years ago
Other questions:
  • ( answer goes here) are pictures that you can click on to tell your computer what to do.
    10·2 answers
  • Which type of cause and effect organizer would be best for alisha to understand how crude oil becomes gasoline?
    6·2 answers
  • What can you learn at Udemy.com?
    11·1 answer
  • Which best describes what a bibliography includes?
    8·1 answer
  • What is this app for ?
    10·2 answers
  • If you ship bakudeku. I swear. <br> *RANTS*
    11·1 answer
  • What specific job usually includes the important pre-production step of making the
    12·1 answer
  • I have this project and I can't do anything about it, I do really need help ASAP
    5·1 answer
  • A person is riding a bike and accelerating at 2.8 m/5 2 eith a force of 100 n
    6·1 answer
  • What is Smart Content Profits all about?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!