A program that asks the user to enter a word

Assignment Help Computer Engineering
Reference no: EM132113576

PYTHON PROGRAMMONG

Write a program that asks the user to enter a word. The program then reads ‘The Raven' by Edgar Allen Poe from a text file, and returns the number of times that word appears.

You will need:

A text file with the poem in it. (A copy of the file has been uploaded to Canvas.) Make sure to download it to an appropriate location on your computer!

Two input objects - one to read the user's word from the keyboard, and another to read the text file.

A while loop to read the poem.

The loop will use the predefined method to ensure that the contents of the files are read.

Use the next method instead of the nextLine method to read word by word.

You will need a nested if statement - this will be used to compare the user's word to every word in the poem.

Code Shell

Reference no: EM132113576

Questions Cloud

Write a function to append lines to a file : Write a function to append lines to a file. Do this in a loop that would allow the user to continue adding lines to a file until they enter the letter q.
Write a program to provide information on the height : Write a program to provide information on the height of a ball thrown straight up into the air.
Determine whether the effect of one variable : Suppose you are trying to use linear regression analysis to determine whether the effect of one variable, X1, on another variable, Y, depends upon
Write a program that opens a specified text file : Write a program that opens a specified text file and then displays a list of all the unique words found in the file.
A program that asks the user to enter a word : Write a program that asks the user to enter a word. The program then reads ‘The Raven' by Edgar Allen Poe from a text file, and returns the number of times .
Stochastic processes-branching process : Let {Xn : n 1} be a branching process with X0 = 1 whose offspring ??? distribution has mean µ =E(???) ??? (0, ?8? ).
People in the study reported sleep improvement : a. Create two-way table of the data. Include row and column labels, as well as totals across and down.
Identify the explanatory and response variables : Identify the explanatory and response variables, indicating which one is each, and whether the variable is categorical or quantitative.
A program to display the amount of the discount : Write a program that asks the user to enter the nmber of packages purchased. the program should then displa the amount of the discount.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain concept of pipelining outline hardware design issues

The purpose of the paper is to expand on concept of pipelining outline hardware design issues involved in task. Address question "how pipelining helps to improve performance of the system and what are its potential hazards."

  The checkedchanged event is raised for a radio button

cis407a- The CheckedChanged event is raised for a radio button whenever the checked property of _____. The ________ displays a text box and button for users to browse, select, and upload a file.

  Identify emerging factors which drive customer demands

Identify current and emerging factors which drive customer demands and requirements for technologies, products, and services.

  How to illustrate a memory map for a system

Illustrate a memory map for a system with a memory capability of 512MB. Each memory location in system is 8 bits.

  Process that handles the customervalidator''s servervalidate

Write down a method that handles the CustomerValidator's ServerValidate event. In addition, write a JavaScript function for the CustomValidator's CustomValidationFunction property. Each method should verify that the user entered an integer in each..

  Design a program which asks for the number of tickets sold

a dramatic theater has three seating sections and it changes the following prices for tickets in each section section a

  How is the approach in health informatics and health

how is the approach in health informatics and health information technology different and how is this difference

  Topics you have identified that you did not understand or

1. prepare a reflective essaynbspin which you address each of the following itemsa. descriptions of how you feel you

  Write a method that calls the method designed in

Write a method that calls the method designed in. If the method throws an exception, force the price of the job to 0.

  Compare the two mean nusselt numbers

For laminar flow over a constant-heat-flux surface develop two expressions for the mean Nusselt number. In the first case base the heat-transfer coefficient.

  Find a maximum-size independent set in g

An independent set of a graph G=(V;E) is a subset V`C= V of vertices such that each edge in E is incident on at most one vertex in V`. The independent-set problem is to find a maximum-size independent set in G.

  Write the code for an ordered linked list module

Select Makefile from the file list and hit Compile/Validate. This will compile ordereList.c and main.c, producing an executable named main. If you double click main, the program will execute and should produce the output shown in the example below..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd