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

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.
Computers and Technology
1 answer:
elena-14-01-66 [18.8K]3 years ago
5 0

Answer:

Check the explanation

Explanation:

we can now create a file named simple.txt which contains two lines of text

below is the solution to the question:

def file_listers(filename,strlist):

name=raw_input(filename)

file = open(file, 'w')

with file as ≠:

for i in range(0, len(strlist) ):

f.write(strlist[i]+"\n")

file. close();

You might be interested in
What does XML do with a data wrapped in the tags?
Arlecino [84]

Answer:

Especificación para diseñar lenguajes de marcado, que permite definir etiquetas personalizadas para descripción y organización de datos. ¿Para que sirve XML? Representar información estructurada en la web (todos documentos), de modo ... Las etiquetas se definen para crear los documentos, no tienen un significado

Explanation:

5 0
3 years ago
write a recursive bool valued function containsvowel that accepts a string and returns true if the string contains a vowel
zhannawk [14.2K]

Answer:

Write a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel. A string contains a vowel if: The first character of the string is a v…

Explanation:

A:

bool containsVowel (string s) { bool hasVowel=false; if (s.length()==0) return false; else if (s[0]=='a'|| s[0]=='e'|| s[0]=='u'|| s[0]=='o'|| s[0]=='i'|| s[0]=='A'|| s[0]=='E'|| s[0]=='U'|| s[0]=='O'|| s[0]=='

7 0
3 years ago
Write a small program that takes in two numbers from the user. Using an if statement and an else statement, compare them and tel
kap26 [50]

What code is it java, HTML,C++ or lua?  be specific.

4 0
3 years ago
Read 2 more answers
100 points !!! Some games fall under more than one category. For example, many racing games allow players to modify the cars the
Ugo [173]

Answer:

game 1: roblox, its not technically a game, however it contains game that could fall under more than one category. Game 2: Dungeons and Dragons could fall under role play and also adventure

Explanation:

7 0
3 years ago
Read 2 more answers
Consider the following relation for published books: BOOK (Book_title, Authorname, Book_type, Listprice, Author_affil, Publisher
Ivenika [448]

The key for this relation is Book_title,Authorname. This relation is in 1NF and not in 2NF as no attributes are FFD on the key. It is also not in 3NF

<u>Explanation:</u>

<u> lGiven the relation </u>

<u>l</u>Book(Book_title, Authorname, Book_type, Listprice, Author_affil, Publisher)

land the FDs

lBook_title . Publisher, Book_type

lBook_type . Listprice

lAuthorname .Author_affil

(a) The key for this relation is Book_title,Authorname. This relation is in 1NF and not in 2NF as no attributes are FFD on the key. It is also not in 3NF

(b) 2NF decomposition:

lBook0(Book_title, Authorname)

lBook1(Book_title, Publisher, Book_type, Listprice)

lBook2(Authorname, Author_affil)

<u> This decomposition eliminates the partial dependencies. </u>

3NF decomposition:

lBook0(Book_title, Authorname)

lBook1-1(Book_title, Publisher, Book_type)

lBook1-2(Book_type, Listprice)

lBook2(Authorname, Author_affil)

l<u>This decomposition eliminates the transitive dependency of Listprice </u>

8 0
3 years ago
Other questions:
  • What does the acronym vsepr represent {spelling is important} question 1 options:?
    12·1 answer
  • SecOps focuses on integrating the need for the development team to provide iterative and rapid improvements to system functional
    11·1 answer
  • 3. Which one of the following statements is true for spell checkers?
    11·1 answer
  • Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
    10·1 answer
  • Mention 5 advantages of internet​
    8·1 answer
  • Which expression is equivalent to 3x + 3x + 3x?<br><br> From Performance Matters
    11·2 answers
  • An organization has hired a new remote workforce. Many new employees are reporting that they are unable to access the shared net
    11·1 answer
  • PLEASE HELP ILL MARK BRAINLIEST!!!
    10·1 answer
  • Which property do you use to align an element horizontally with the left or right edge of its parent element?
    6·1 answer
  • Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y =
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!