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
Azzam is reviewing a paper he just wrote about kinetic friction for his physics class. On the third page, he realizes that every
bogdanovich [222]

Answer: Azzam used the tool while he was on the third page

Explanation:

The most likely the reason why the phrase was not fixed is because Azzam used the tool while he was on the third page.

This can be infered from the information given when we're told that he uses the Find and Replace tool and clicks on "Replace All" to fix the issue with regards to the error that he made and thus was done from the third page. Therefore, the tool might not have worked for the first page.

4 0
3 years ago
Joe, a user, reports to the help desk that he can no longer access any documents on his PC. He states that he saw a window appea
posledela

Answer:

The answer is most likely B) Trojan.

Explanation:

8 0
3 years ago
Hymter. Wants to workin The Energy career field with electrical energy
m_a_m_a [10]

Answer: what is the question

Explanation:

3 0
3 years ago
Can someone help me pz?
Katarina [22]
Yes definitely. now what do you need help with?
8 0
2 years ago
While investigating an email issue, a support technician discovers no users can access their email accounts on the company’s ema
PolarNik [594]

Answer:

C. Escalate the problem to a server administrator to check for issues with the server.

Explanation:

Pinging is a tool or program that IT technicians and professional for testing if a particular host or server is reachable. Since after the support technician pinged the email server from various location and the LAN results in 0% packet loss, this means that the fault is not from the LAN, but that the host server or server administrator is unreachable or have issues. Thus, the next step of troubleshooting is to escalate the issue to the server administrator to check for issues with their server.

5 0
3 years ago
Other questions:
  • Virtually all webcams plug into a(n) ________ port.
    13·2 answers
  • PLEASE HELP ASAP!!!!
    14·1 answer
  • Two technicians are discussing the voltage measurements taken on the circuit below: V1 = 12Volts; V2 = 12Volts; V3 = 0Volts; V4
    11·1 answer
  • Observe the things at Home in which you are using binary
    7·1 answer
  • What is the post condition of an expression or variable
    11·1 answer
  • Read an integer from keyboard and then print the result of the sum obtained by adding the entered integer to the integer formed
    11·1 answer
  • What type of game is LEAST LIKELY to need a structured narrative?
    6·1 answer
  • The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours; any hours worked be
    11·1 answer
  • Which key(s) will launch the Spelling Checker dialog box? F8 F7 Ctrl+H F2
    11·2 answers
  • Differentiate between tabular and column form layout​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!