subject

Define a Python function named file_listers with two parameters. The first parameter will be a string specifying the name of the file to write to. The second parameter will be a list of str. Your function should open the file in a manner that erases its contents. For each entry in the second parameter, write it to the file and then a newline. Your function does not need to return anything. Example:list_2_file("empty. txt", []) creates a file named empty. txt but that file will be empty. list_2_file("simple. txt", ["Write", "me"]) creates a file named simple. txt which contains two lines of text. The first line has the text Write and the second line says me.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
Write a function 'music_func' that takes 3 parameters -- music type, music group, vocalist -- and prints them all out as shown in the example below. in case no input is provided by the user, the function should assume these values for the parameters: "classic rock", "the beatles", "freddie mercury". for example: input: alternative rock,pearl jam,chris cornell output: the best kind of music is alternative rock the best music group is pearl jam the best lead vocalist is chris cornell note: the print statements will go inside the for example: print("the best kind of music is"
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
The gene form of a trait is called a(n) 
Answers: 2
You know the right answer?
Define a Python function named file_listers with two parameters. The first parameter will be a strin...
Questions
question
Mathematics, 05.02.2021 17:40
question
Mathematics, 05.02.2021 17:40
question
Mathematics, 05.02.2021 17:40