The Directory.txt file contains names of the employees and their phone numbers in the following order. Last name, First name, Phone. The creator of this file made several mistakes by typing commas and dots inconsistently. Nrite a Python program to read this file and produce an output file with the name DirectoryNew.txt. This file should format the phone directory as follows: Phone First name Number 1 First name 1 Number 2 First name 2 The file MUST end with: End of directory Edit Metadata
Q: You will create a new version of the restaurant ordering program you created below in which the…
A: I have used "menu.txt" for the menu items as opposed to the predefined lists. def…
Q: In Python Prompt the user for a text file that contains a list of student names, one on each line.…
A: NOTE: Follow proper indentation. sample data not given in the question. so, random data considered…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Run a python program that will receive a chemical compound formula as an input and will give its…
A: The mass.csv file is read using the csv module, which is imported in the code. The with statement is…
Q: Suppose you are given a text file named "input". The file includes 100 lines. Each line of the file-…
A: Based on Java
Q: In the game of scrabble, each letter is associated with a number of points. It is these points that…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: In python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines.…
A: Given: In python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100…
Q: Write a python program that will ask the user for their grocery list, one item at a time, and will…
A: here in given question ask for write program in python as per question staatement.
Q: Write a program that does the following: Reads information from a text file into a list of…
A: Actually, the code has given below:
Q: Follow these steps: ● Create a new Python file in this folder called replace.py. ● Save the…
A: The PYTHON program is given below with code and output screenshot string[: :-1] is used to reverse…
Q: Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines. 2. Each line in…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.…
Q: In Python Take the Deck of cards we created in Problem Solving Exercise: Shuffle and Deal Cards and…
A: Note: we had provided answer according to given hints provided in solution parts.
Q: Read a text file and displays its contents on the screen., but replace every 'h' character it finds…
A: sample output
Q: Write a java program to read from the Keyboard name of the item and its price until the user Enter…
A: Step 1 : Start Step 2 : In the main method , declare the array of strings to store the item names…
Q: A company stores payment information for their employee working on a project and paid on a project…
A: In question, you have said that the .txt file's first line will indicate the number of employees but…
Q: Rercise 3: A company stores payment information for their employee working on a project and paid on…
A: 61 answers Python Code: try: f = open('myfile.txt', 'r') except IOError: raise IOError("Error:…
Q: In this assignment, you will create a Java program to read undergraduate and graduate students from…
A: Code:- StudentIDComparator.java import java.util.ArrayList;import java.util.Collections;import…
Q: Below this question is a generated text representing a DNA sequence. The first line starts with '>'…
A: The algorithm steps to write the given function gcContent(sequence) are given below:- First, count…
Q: Modify task1.c so it will read from standard input, convert lowercase letters to uppercase letters,…
A: C program, read from standard input converting lowercase into uppercase letter and write standars…
Q: Please answer it in Python In the game of scrabble, each letter is associated with a number of…
A: Hey there, I am writing the required solution of the above stated question.Please do find the…
Q: Q. Write a python program that creates an excel file containing Student Record: Roll No.,Name, Marks…
A: GIVEN: A python program that creates an excel file containing Student Record:Roll No.,Name, Marks…
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Using python 2.7 def printHeader():print…
Q: Write a program that will read a file from the user and writes its content in another file such that…
A: required: Write a program that will read a file from the user and writes its content in another file…
Q: This is a Python program Reads information from a text file into a list of sublists. Be sure to…
A: A require program is as follows, import datetime import os # Define a function that returns a list…
Q: Python Run an object oriented python program that will guess for a person’s age based on their…
A: Ans:) In this program we follow the below approach: read data line by line and create a person…
Q: A company stores payment information for their employee working on a project and paid on a project…
A: We have to write a python program that is as follows:-
Q: Write a python program that does the following: Reads information from a text file into a list of…
A: Actually, the code has given below:
Q: Write a Python program that reads from the user the name of two files (an input file and an output…
A: code :-- # getting the input an output file name from user file_in = input('Enter input file name :…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: A file named gang.txt is shown below. Write Python code that opens this file, reads only the first…
A: def file_read_from_head(fname, nlines): from itertools import islice…
Q: Exercise 1: Write a python program that reads from a text file whose name is provided by the user…
A: from os import pathfile_name=input("enter file name: ")if(path.exists(file_name)): #checking if file…
Q: In a python program, create a new file and call it “ tracking”. Write to it four lines each contains…
A: Python Code for the above Question is given below
Q: In python: The file contain the content in the form pet1,pet2,pet3 Output will return [[‘pet1’,…
A: Here I have created a function named read_file(). In this function, I have opened the file in read…
Q: In Java A comma separated value (.csv) file has been included to be used for this program. Each…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: File sourceFolder, String filename
A: Answer: Note: Done accordingly. Please comment for any problem. Please Uprate. Thanks Code: package…
Q: The name should be able to be sorted last name first. Profession should be able to be sorted…
A: q: The name should be able to be sorted last name first. Profession should be able to be sorted…
Q: It contains data for one movie on each line. Each Movie contains the following data items:…
A: Program firstly gets the local directoty path. The source file path has been stored into a variable…
Q: In Java Oleae nust read a file A photographer is organizing a photo collection about the national…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: In Python, Use number.txt file (below). create a program that opens num.txt, a file consisting of a…
A: The above question is solved in step 2 :-
Q: Given a text file containing the availability of food items, write a program that reads the…
A: Here is the python code: See below step for code. Foot.txt
Q: Write a python program that will ask the user for their grocery list, one item at a time, and will…
A: Answer:
Q: Python Code: Below is an open link to file needed in this program Spots:…
A: Code: import numpy as npimport matplotlib.pyplot as plt # opening file in read…
Q: Assume a text file named “myNumbers.txt” contains integers separated by a new line. Using Repl.it,…
A: To solve the given problem you need to read a text file and then perform the calculation to get…
Q: This is a python file Fix this code and the output is the attachment #filename:…
A: You have used “from modValidateEmail import *” and this is not a module in python library and there…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The Answer start from step-2.
Q: reads in a file of student academic credit data. Each line of the input file will contain the…
A: Programming is instructing a computer to do something for you with the help of a programming…
python 3
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- In Python Prompt the user for a text file that contains a list of student names, one on each line. Also prompt the user for a CSV file that contains scores for the students in the following order: homework1, homework2, midterm exam, final exam. Each line in the CSV has four scores, delimited by a comma. Each name in the text file has the corresponding scores in the CSV file. You will need to calculate the weighted final grade for each student as follows: 5% homework1 5% homework2 40% midterm exam 50% final exam Homework is scored out of 10 points and exams are scored out of 100 points. You need to create a program that will read the scores from the CSV file, calculate the weighted final grade, and display the resulting final grade, along with the student's name. Sample input files are attached. You can assume that the same number of lines will be in the input files, and that the order of the names and corresponding grades is the same in the two files. Display the name and final grade…create a Python program that: Opens a file and reads the contents of the following file trips.txtDownload trips.txt The file contains several lines of data, with each data item separated by commas. The data is: A trip date The amount of fuel used on the trip The number of miles traveled on the trip For each of the lines of data in the file, separate the data items and put them in appropriate variables The file contents are in the form of strings, so you must convert the numbers in the data into the proper type Create a function that calculates the fuel mileage achieved on each trip Pass the appropriate data to this function Place this function in a separate module Call the function as needed and have the function return the calculated fuel mileage Create a function that displays the following items on a single line, and place the function in the same module as the previous function. Pass the appropriate data to this function Trip data Amount of fuel used Numbers of…Write a python program that does the following: Reads information from a text file into a list of sublists. Be sure to ask the user to enter the file name and end the program if the file doesn’t exist. Text file format will be as shown, where each item is separated by a comma and a space:ID, firstName, lastName, birthDate, hireDate, salary Store the information into a list of sublists called empRoster. EmpRoster will be a list of sublists, where each sublist contains the information for one employee.The birthDate and hireDate in file are strings, but should be stored as objects of type Date.Example of EmpRoster list with 2 employees:[ [111,”Joe”, “Jones”, “09-01-1980”,”10-19-1999”, 95000], \ [222, “Sam”, “Smith”, “07-10-1956”,, “01-01-2000”, 50000] ] Print a report that shows the following: Employee RosterID First Name Last Name Birth Date Age Hire Date YrsWorked Salary WRITE the following information out to a…
- Write a Python program sentences.py that prompts for multiple sentences. The program should write the sentences without punctuations with the words in reversed order and in uppercase in a new file named sentences.txt. All words must be separated by single space. Example 1 prompt (input:) Enter a sentence: What's your address?Enter a sentence: 964 S. Monroe Ave. Naugatuck, CT 06770Enter a sentence: quit (output:) (In a new file) ADDRESS YOUR WHATS 06770 CT NAUGATUCK AVE MONROE S 964Write a program that reads student data from a file, compute their GPA and writes the results to a different file. 1. The user should have the option to either enter their text file that contains the student grades or use the provided text file that contains theinformation. The data in "indata.txt" should look similar to this, Lara_Croft75 70 91 69 89Chris_Redfield68 88 79 85 94Johnny_Cochran69 98 95 77 80Wanda_Maximoff84 86 98 95 92Luke_Skywalker74 96 80 98 97William_Kurt89 52 99 81 58Samuel_Jackson50 96 50 64 95END_OF_FILE This is supposed to be in python. This is what I have so far. I have no experience I apologise. I am trying to finish the GPA calculating program currently but am having trouble finishing it. grade = input("enter grades")points = 0 if grade is 90-99:total_points = 4.0if grade is 80-89:total_points = 3.0if grade is 70-79:total_points = 2.0if grade is 60-69:total_points = 1.0if grade is 50-59:total_points = 0.0gpa = total_points/len(grade)print(gpa,"is gpa")Our requirement is to keep information of students who are taking “Introduction to Python” in Fall-2021 in a text file named ‘Students.txt’. The first line of text in this file will be header line as follows Write a python code that: Takes StudentID from user as input in a variable ‘inputID’, reads the file line by line and displays the header line and student information when inputID is found in Students.txt, otherwise display a message ‘Record not found in Students.txt’
- Please answer it in Python In the game of scrabble, each letter is associated with a number of points. It is these points that make it possible to calculate the score of each player at the end of the game. We would like our program to be able to choose, among the words we can play, the one with the highest total of points. To do this, we store the points corresponding to each letter in a text file called points.txt. Each line in this file contains a letter and its number of points, separated by spaces. Points.txt= https://tinyurl.com/pointtxt Download the points file.txt to your working directory. Write a function score_mot (points, word) that takes as an argument a dictionary matching each letter its number of points, and a word, and that returns the score. For example: What letters do you have in hand ? SALUT #return => Here's the best word you can play: SALUT for a score of: 5Please answer it in Python In the game of scrabble, each letter is associated with a number of points. It is these points that make it possible to calculate the score of each player at the end of the game. We would like our program to be able to choose, among the words we can play, the one with the highest total of points. To do this, we store the points corresponding to each letter in a text file called points.txt. Each line in this file contains a letter and its number of points, separated by spaces. Points.txt= https://tinyurl.com/pointstxt 1. Download the points file.txt to your working directory. 2. Write a function read_points() that reads the points file.txt and returns a dictionary that matches each letter to its number of dots (integer). 3. Write a function score_mot (points, word) that takes as an argument a dictionary matching each letter its number of points, and a word, and that returns the score. For example: What letters do you have in hand ? taslu #return => Here's…Write a Python program that reads from the user the name of two files (an input file and an output file). The program will then read each line of the input file and save it in the output file preceded with the line number and removing any of the following punctuations (. , ! ? ; :) found at the end of the line. For example, if the input file is:Mary had a little lamb;Whose fleece was white as snow; And everywhere that Mary went; The lamb was sure to go!Then the output file the content of the input file and saves it in the produced output file will beLine 1: Mary had a little lambLine 2: Whose fleece was white as snow Line 3: And everywhere that MaryLine 4: The lamb was sure to go
- For an e-Shop, there is a Customer whose data is stored in a file ‘Customers.txt’, where ID, Name, Phone, Address, Email and AmountBalance. When the customer buys a product and pays from his AmountBalance, the system checks his balance and deducts if enough amount is there. Otherwise the customer receives a message “You don’t have sufficient Balance in your wallet”. Write python code to create a ‘Customers.txt’ file with at least one customer’s record. Write a function pay(), that takes amount as an input, reads the file and gets AmountBalance, print “Successful Transaction” when payment can be made or a message “You don’t have sufficient Balance in your wallet”. Write a function checkBalance(), that reads the file and gets AmountBalance, prints “Amaount Balance” Write a function recharge(), that takes “Enter Amount you want to recharge”, reads the file and gets AmountBalance, adds the new amount in AmountBalance, update the file and prints “Success”in python Given a set of text files containing synonyms for different words, complete the main program to output the synonyms for a specific word. Each text file contains synonyms for the word specified in the file’s name, and each row within the file lists the word’s synonyms that begin with the same letter, separated by a space. The program reads a word and a letter from the user and opens the text file associated with the input word. The program then stores the contents of the text file into a dictionary predefined in the program. Finally the program searches the dictionary and outputs all the synonyms that begin with the input letter, one synonym per line, or a message if no synonyms that begin with the input letter are found. Hints: Use the first letter of a synonym as the key when storing the synonym into the dictionary. Assume all letters are in lowercase. Ex: If the input of the program is: educate c the program opens the file educate.txt, which contains: brainwash brief…in python: Given a set of text files containing synonyms for different words, complete the main program to output the synonyms for a specific word. Each text file contains synonyms for the word specified in the file’s name, and each row within the file lists the word’s synonyms that begin with the same letter, separated by a space. The program reads a word and a letter from the user and opens the text file associated with the input word. The program then stores the contents of the text file into a dictionary predefined in the program. Finally the program searches the dictionary and outputs all the synonyms that begin with the input letter, one synonym per line, or a message if no synonyms that begin with the input letter are found. Ex: If the input of the program is: educate a then the program outputs: No synonyms for educate begin with a.