Question
Asked Oct 13, 2019
45 views

Python 3.7.4

Write a statement to open the file priceList.txt for writing.

check_circle

Expert Answer

Step 1

To open the file priceList.txt for writing, the statement is: f=open('priceList.txt','w')

The following is the source code to open/create the file and write the data in the file priceList.txt.

Step 2

Source Code

f=open('priceList.txt','w')  # for creating the file and writing data to that file the acronym is w.

f.write("Hello!!This is priceList.txt file") # this statement will write the content in the file.

f.close() # close the file

Step 3

Screenshot of the code...

help_outline

Image Transcriptionclose

f-open('priceList.txt,'w') # for creating the file and writing data to that file the acronym is w. f.write("Hello !! This is priceList.txt file") # this statement will write the content in the file. f.close close the file

fullscreen

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Please help me with this, I'm stuck...

A: The DFA is a 5- tuple {Q, ∑, q, F, δ}:Q = {q0, q1, q2, q3, q4}∑ = w | w is a string over {a, b} that...

question_answer

Q: How many lines does his algorithm print? Write a recurrence and solve it.function printaton(n: an in...

A: The given program splits into three subprograms with half of the input size each and then prints n^4...

question_answer

Q: program5_2.pyWrite a program that determines the cost of painting the walls of a windowless room. Th...

A: A Python program that determines the cost of painting the walls of a windowless room is given below;...

question_answer

Q: please help me solve this problem in C++

A: Program AlgorithmDeclare the required variables and an array.Then write a for loop to generate three...

question_answer

Q: Python 3.7.4 Assume that print_todays_date is a function that uses no parameters and returns no valu...

A: A statement that calls (invokes) the function print_todays_date is: print_todays_date()This function...

question_answer

Q: Show the binary representation for the phrase " University of Akron."

A: Binary is a base 2 system that uses only two digits 1 or 0. Computer store data and perform operatio...

question_answer

Q: Linux servers 1. Cceate FOLDERNAME, script that gven a will create dinectocy named dircetory, and Su...

A: Open Linux editor using command "vi newclass.sh".To enter input in the empty editor with name newcla...

question_answer

Q: in python   Write a program that the owner of Chica Chic could use to store data about her inventory...

A: To create a python program which stores the inventory details such as name of item, cost of item and...

question_answer

Q: Please explain how you solve the follwing problem:

A: a) CHAIN set for each variable:CHAIN(S) = {B, C, A}CHAIN(A) = {A}CHAIN(B) = {B}CHAIN(C) = {C, A}