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
beks73 [17]
2 years ago
15

Given an initialized variable fileName, write a sequence of statements that create a file whose name is given by the variable an

d whose content is a single line consisting of "This Is File: " followed by the name of the file. Make sure that the data written to the file has been flushed from its buffer and that any system resources used during the course of running these statements have been released.
Computers and Technology
1 answer:
steposvetlana [31]2 years ago
6 0

Answer:

In Python:

fileName = "myfile.txt"

fname = open(fileName, "w")

fname.write("This Is File: "+str(fileName))

fname.close()

Explanation:

This initializes fileName

fileName = "myfile.txt"

This creates the file in write mode

fname = open(fileName, "w")

This writes the required string to the file

fname.write("This Is File: "+str(fileName))

This closes the file

fname.close()

You might be interested in
Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For
WARRIOR [948]

I have write a very simple code for you in python and i hope it will help you a lot.


def generateString(char, val):

   print(char * val)

Explanation:

This is how you can create your function in python and this function will give you the desired output.


How to Call a function:

generateString('a',12)

this is how you can call the function to get output.

I hope you get the idea.



5 0
3 years ago
Read 2 more answers
How do you suppose a request travels from one computer to another? How does the request know where to go?
Luden [163]
It can request a signal then transfer certain data points and provide the request. The request knows where to go using certain lines in the data.
4 0
2 years ago
Describe at least one issue of terrorism that has happened recently.
zvonat [6]

Answer:

The republicans storming the capitol

Explanation:

6 0
2 years ago
If given program is executed, what will be output?
iogann1982 [59]

Answer:

16 22 399 214 351

Explanation:

es 1 .22 399 480

3 0
2 years ago
Write the name of the tab, command group, and icon you need to use to access the borders and shading dialog box.
Ilia_Sergeevich [38]

Answer:

Tab: Home Tab

Command group: Paragraph

Icon: Triangle

Explanation:

7 0
3 years ago
Other questions:
  • Jane is a postproduction crewmember for a film. Her responsibilities include arranging all the scenes that have been shot into t
    7·1 answer
  • Have you ever used a device that relies solely on the cloud?
    10·1 answer
  • According to Mintzberg's classification of managerial roles, the role of a(n) ______ is to transmit information received from ou
    7·1 answer
  • Holly would like to run an annual major disaster recovery test that is as thorough and realistic as possible. She also wants to
    5·1 answer
  • What software is typically used for larger systems?
    11·1 answer
  • 1. [2 points] Write a function to compute the volume of a sphere, given its radius. 2. [2 points] Write a recursive function to
    7·1 answer
  • Write a c++ program to calculate the approximate value of pi using this series. The program takes an input n that determines the
    13·1 answer
  • Answer for 5,6,7 any one know plz
    8·1 answer
  • The TCP _____ is the amount of information that a machine can receive during a session and still be able to process the data.
    5·1 answer
  • What is output?<br> x = 2<br> y = 3<br> print (x * y + 2)<br> 4<br> 2<br> 8<br> 10
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!