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
50 points please!!
MA_775_DIABLO [31]

Answer:

poopypoopypoopypoopy

6 0
3 years ago
Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
posledela

Answer:

#include <iostream>

using namespace std;

double DrivingCost(int drivenMiles,double milesPerGallon,double dollarsPerGallon)

{

   double dollarsperMile=dollarsPerGallon/milesPerGallon;//calculating dollarsperMile.

   return dollarsperMile*drivenMiles;//returning thr driving cost..

}

int main() {

double ans;

int miles;

cout<<"Enter miles"<<endl;

cin>>miles;

ans=DrivingCost(miles,20.0,3.1599);

cout<<ans<<endl;

return 0;

}

Output:-

Enter miles

10

1.57995

Enter miles

50

7.89975

Enter miles

100

15.7995

Explanation:

In the function first I have calculated the dollars per mile and after that I have returned the product of dollarspermile and driven miles.This will give the cost of the Driving.

4 0
3 years ago
A data analyst is using the Color tool in Tableau to apply a color scheme to a data visualization. They want the visualization t
alina1380 [7]

Answer:

Color contrast is the difference in light between font (or anything in the foreground) and its background.

Explanation:

In web accessibility, how well one color stands out from another color determines whether or not most people will be able to read the information.

Contrast makes things look different and stand out

6 0
3 years ago
What are the three most popular form factors used for motherboards?
Darina [25.2K]
ATX
microATX (smaller version of ATX)
mini-ITX (smaller version of microATX)

5 0
3 years ago
Read 2 more answers
Explain the RISC and CISC architecture. Comparison of RISC and CISC in detail.
puteri [66]

Answer:RISC(reduced instruction set computer) is the computer used for low level operation by simple command splited into numerous instructions in single clock only and CISC(Complex instruction set computer) is the computer that performs the operation in single instruction.

RISC architecture has hardwired control unit,data cache unit,data path ,instruction cache and main memory as components .CISC architecture persist of  control unit,micro program control memory, cache, instruction and data path and main memory.

The differences between RISC and CISC are as follows:-

  • The instruction in RISC are less and and low complexes while CISC has several number of complex instruction.
  • The calculation done by RISC are precise and quick whereas CISC has slightly slow calculation processing.
  • The execution of RISC is faster as compared to CISC.
  • RISC uses hardware component for implementation of instruction because it does not persist its own memory and CISC implements instructions using its own memory unit .

6 0
3 years ago
Other questions:
  • Assume that an int variable age has been given a value. Assume further that the user has just been presented with the following
    14·1 answer
  • On what dates did the 2016 Olympics take place( list all)
    9·2 answers
  • When did the digital revolution begin
    10·1 answer
  • What is used to monitor the activity of a network and notify network administrators when it identifies something as suspicious?
    15·1 answer
  • What is the most recent version of Microsoft Windows?
    12·2 answers
  • You manage a small LAN for a branch office. The branch office has three file servers and few client workstations. You want to us
    14·1 answer
  • If we compare the push function of the stack with the insertFirst function for general lists, we see that the algorithms to impl
    9·1 answer
  • If two egg cells are fertilized what will happen?
    10·1 answer
  • PLZZZ HELP MEE i need it done today
    7·1 answer
  • Which type of attack can be addressed using a switched ethernet gateway and software on every host on your network that makes su
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!