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
Contact [7]
3 years ago
7

The function takes two string parameters; the first is the name of a file and the second is text. Complete the function to appen

d the string text onto the end of the file named filename. You'll want to open the file for appending and then you can use a single write function call to complete the write. Be sure that you close the file, either with an explicit close function call or by using a with statement.
Computers and Technology
1 answer:
castortr0y [4]3 years ago
3 0

Answer:

The code for the function is given below in Python language

Explanation:

def append_string_to_file(filename, text):// function takes the filename // and text  to append

f = open(filename, 'a')

f.write(text) //function part that writes the text

f.close() //closing the file using the explicit close function

You might be interested in
Write a program that displays in the title of the window the position of the mouse as the user moves the mouse around the window
12345 [234]
The java program displays these 
4 0
3 years ago
Implement a Python function with the signature Transfer(S, T) that transfers all elements from the ArrayStack instance S onto th
Mashutka [201]

Answer:

Following are the program in the Python Programming Language.

#define function

def Transfer(S, T):

 #set for loop  

 for i in range(len(S)):

   #append in the list

   T.append(S.pop())

 #return the value of the list

 return T

#set list type variable

S = ["a","b","c","d"]

#print the values of the list

print(S)

#set the list empty type variable

T=[]

#call the function

T = Transfer(S, T)

#print the value of T

print(T)

<u>Output:</u>

['a', 'b', 'c', 'd']

['d', 'c', 'b', 'a']

Explanation:

Here, we define the function "Transfer()" in which we pass two list type arguments "S" and "T".

  • Set the for loop to append the values in the list.
  • Then, we append the value of the variable "S" in the variable "T".
  • Return the value of the list variable "T" and close the function.
  • Then, set the list data type variable "S" and initialize the elements in it and print that variable.
  • Finally, we set the empty list type variable "T" and store the return value of the function "Transfer()" in the variable "T" then, print the value of the variable "T".
4 0
2 years ago
Effective character encoding requires:
Dvinal [7]

To answer your question the answer would be B compatible browsers

8 0
3 years ago
The Internet was first used by which of the following institutions?
Phantasy [73]

Answer:

U.S Department of Defense

Explanation:

(btw nazi party was around before the internet and ended before the internet therefor couldn't be that)

5 0
2 years ago
How do you create a function in C++
MArishka [77]

Answer:

1. Declaration: the return type, the name of the function, and parameters (if     any)

2. Definition: the body of the function (code to be executed)

Explanation:

7 0
1 year ago
Other questions:
  • Your Economics teacher has asked you to create a chart showing how supply and demand affects the price of gasoline. Which applic
    13·2 answers
  • Hi <br> What exactly does this project want from me?thanks for riding
    5·1 answer
  • Suppose the information content of a packet is the bit pattern 1110 0110 1001 1101 and an even parity scheme is being used. What
    15·1 answer
  • How do I make my own extension for chrome?
    7·1 answer
  • How to write a program to draw 1000 random points on a frame in python language for coding?
    13·1 answer
  • How to get bing with any node unblocker
    10·2 answers
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • Drag the right word to it’s definition
    13·1 answer
  • 14. Which of the following is NOT a
    6·2 answers
  • What if you accidentally delete your browser history
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!