Write a program to read in a file and count how many times any two particular words occur in succession

Answers

Answer 1

Answer:

Explanation:

The following code is written in Python, it is a function that takes in the file location and two words as arguments. Then it reads the file and loops through to see if those two words are found in succession and how many times. Finally it returns the number of times those words are found in succession within the file.

def countSuccession(file, word1, word2):

   file = open(file, "r")

   words = file.read()

   words = words.replace('.', '')

   words = words.split(' ')

   count = 0

   for index in range(len(words)):

       if words.__getitem__(index) == word1 and words.__getitem__(index + 1) == word2:

           count += 1

   return count

Write A Program To Read In A File And Count How Many Times Any Two Particular Words Occur In Succession

Related Questions

Use the drop-down menus to match each description to the correct term.
Stores information in columns and rows
Smallest unit of information, e.g. 25
Unique identifier for each record, often an ID number
Group of related tables or records
Set of unique information, stored in a row

Answers

The appropriate term with its description are:

Excel spreadsheet: it stores information in columns and rows.Bit: smallest unit of information, e.g. 25.

What is an excel spreadsheet?

A excel spreadsheet can be defined as a type of software program which is designed and develop with cells that are typically arranged in a tabulated format in rows and columns.

How to match the description to the correct term?Excel spreadsheet: it stores information in columns and rows.Bit: smallest unit of information, e.g. 25.Key field: unique identifier for each record, often an ID number.File: it is a group of related tables or records.Primary key: set of unique information, stored in a row.

Read more on spreadsheets here: https://brainly.com/question/4965119

#SPJ2

List at least two questions you can use to help decide whether a website's information is trustworthy

Answers

Answer:

Questions (three) that can be used to decide whether a website's information is trustworthy are;

1) Who is or are the authors of the website

2) What type of information the website conveys

3) Why was the information published on a website

Explanation:

1) Who is or are the authors of the contents of the website including the authors credentials so as to ascertain whether the author is qualified with regards to the topic or topics written about on the website

2) What are the information presented on the website and the context the in which the information are presented

Are the articles in the website backed by a source, with hyperlinks, references or footnotes

3) Why was the on the website information created. Is the information to entertain, persuade, sell or inform

would you be comfortable with a robot adjusting your investment portfolio if it came with significantly lower fees than a human financial advisor? Why or why not

Answers

Answer:

Sure, as long as it gets the job done and doesn't screw things up & is user friendly. I would also want to be able to turn it on and off at will.

Explanation:

does trend in computing important for organization management?​

Answers

Answer:

yes it is...................

Do Not Answer If You Are Going To Give Me A Link! DONT WASTE MY POINTS!!
Choi is trying out for a reality show on television. The application requires a self-portrait. Choi is setting up a self-portrait but wants to get her whole body. How might Choi BEST take a self-portrait that looks professional enough to submit?

A.
She could stand in front of a mirror holding her phone to take the photo.

B.
She could hold up the camera and take a selfie pointed down toward her body.

C.
She could use a self-timer to allow herself to get into position for the shot.

D.
She could ask her friend to take a photo of her as she stands against a background.

Answers

Answer:

My answer may be right nor wrong

A.

Answer: D seems like a good answer because she has a background behind her and it's a full body photo so i will say d looks more professional

Explanation:

PI
s
ne
poem for the
During reading: Work
on the following questions:
suggests
I
a
1
b
What do you predict the poem will be about?
How does the shape support what the titles
How many stanzas does the poem have?
b How many sentences does it have?
3 Read the poem aloud in your group.
2
a
m
Until I saw the Sea by Lilian Moore
ou the Sea​

Answers

Explanation:

As the qn was copy pasted from another document...the qn seems incorrect... and incomplete..

pls see to it and attach the correct qn...

sorry

Ryan is installing new flooring in his house. Ryan can install 169 square feet of flooring in 5 hours. How much new flooring can Ryan install in 35 hours?

Answers

Answer:

1183 square feet.

Explanation:

If Ryan can install 169 square feet in 5hours.

Then, he can install times 7 of that in 35 hours since 35 / 5 = 7

So, 169 x 7 = 1183

What is a difference between Java and Python? (5 points)
a
Java requires brackets to define functions, while Python requires curly braces.
оо
Ob
Python ends lines of code with semicolons, while Java does not.
Python is a statically typed language, while Java is not.
Od
Variable types in Java cannot be changed, while Python allows them to change.

Answers

I'm not sure if this answers your question but I found this online:

The main difference between Java and Python is their conversion; the Java compiler converts the Java source code into an intermediate code called a bytecode while the Python interpreter converts the Python source code into the machine code line by line.

Sorry if this doesn't answer your question.

I'm not sure if this answers your question but I found this online:

The main difference between Java and Python is their conversion; the Java compiler converts the Java source code into an intermediate code called a bytecode while the Python interpreter converts the Python source code into the machine code line by line.

Sorry if this doesn't answer your question.

Choose the correct color to complete the sentence.
It is generally understood that
Blank is the best color choice for a global audience.

Answers

Answer:blue is the best color choice for a global audience.

What is media logic according to David L. Altheide?

Answers

Answer:

Media logic is discussed as a general framework for understanding the nature, impact and relevance of media and information technologies for social life, as well as its use and appropriateness for investigating political communication. (According to David L. Altheide)

Explanation:

I downloaded the hex mod on gamebanana, there was a "do NOT readme" file, I didn't see it at first and tried to open the app, it said "Unrecognized app" I really hope I didn't just get a virus on my computer, the game is fnf

Answers

Answer:

You'll be find. Viruses suck, but everyone gets them at some point. Don't be worried about it. If your computer is acting weird/getting pop-ups, just ask your parent to call the computer company or take it to the store that's owned by your internet provider company (AT&T store, etc.)

Getting a virus is not the same thing as a cyber-attack. It might make things a bit annoying. Worst case scenerio, someone uses a virus software program to gain access to your computer so they can try to find banking info.

Even if that happens (VERY low chance), financial companies associated with your credit card/financial info, etc. pick up on it pretty quickly and call if there's anything suspicious.

Explanation:

Answer:

if its friday night funkin its not a virus

Explanation:

7. What is a slide transition?

Answers

Answer:

Is this multiple choice? If not, its a visual effect from one slide to another.

Explanation:

Answer:

A slide transition is the visual effect that occurs when you move from one slide to the next during a presentation. You can control the speed, add sound, and customize the look of transition effects

Explanation:

hope this helps:)

The First National Bank debited $100.00 from your checking account into your savings account. What would the transaction descripton be?

Answers

Answer:

32 Day Interest Plus

Amount 1 - 32 days (per annum) 33 - 64 days (per annum)

R1 000 - R9 999 0.55% 0.65%

R10 000 - R24 999 0.80% 0.90%

R25 000 - R49 999 1.05% 1.15%

R50 000 - R99 999 1.55% 1.65%

Explanation:

___ design uses the same webpage content, but applies styling depending on the viewport size of the device

Answers

coding design used snake

The following if statement tests the rainfall in New York’s Central Park during the months of June, July and August.

if (low <= rain && rain <= high)
System.out.println("Rainfall amount is normal.");
else
System.out.println("Rainfall amount is abnormal.");
It could be replaced with:
I.

if (rain >= low)
{
if (rain <= high)
System.out.println("Rainfall amount is normal.");
}
else
System.out.println("Rainfall amount is abnormal.");
II.

if (rain >= low)
{
if (rain <= high)
System.out.println("Rainfall amount is normal.");
else
System.out.println("Rainfall amount is abnormal.");
}
else
System.out.println("Rainfall amount is abnormal.");
III.

if (rain >= low)
System.out.println("Rainfall amount is normal.");
else if (rain <= high)
System.out.println("Rainfall amount is normal.");
else
System.out.println("Rainfall amount is abnormal.");
I only
II only
III only
(II or III)
I, II or III

Answers

Answer:

II only

Explanation:

In the original code, both conditions of low<=rain and rain >= high must be met for the print message to be executed. This is denoted by the && logical operator.

The code in II does the same thing. It first checks that the low <=rain condition is true; then it goes on to check if the rain >= high condition is true as well before the "normal" print statement can be executed. But if either of the condition is not true, it prints "abnormal" because both conditions must be true.

Tell me what does WSG mean ​

Answers

Answer:

It could mean many different things but heres some things it could

With Special Guest

World Standard Group

Web Security Guard

Hope this helps!

Don't Answer if you are going to give me a link! Don't Waste My Points!

An image is considered a portrait if the person is looking into the camera lens.

A.
True

B.
False

Answers

Answer:

Hello there! :) It could be considered a portrait but that is not exactly what a portrait is.

Explanation:

A portrait is mostly considered a painting or drawing of someone that that same person has drawn. For example, a portrait of the Mona Lisa would have been her drawing/painting herself. Now someone just looking at camera lens would'nt exactly be true, it would be false so the answer is B. False

Hope this helps!

Answer: False

Explanation: I don't know 100%, but it wouldn't make sense if it was because the person can be really far away and still be looking at camera, as well as be looking slightly away from lens and it still look like a portrait.

In most software programs, which color arrows selects the points in a vector
Black
White
Gray
Red

Answers

Answer:

in think gray is used as arrow color which selects the points in a vector

What are some common summary operations that aggregate functions can perform in a crosstab query? Check all that apply.
adding
counting
dividing
subtracting
identifying an average
calculating a minimum or maximum
predicting the next value in a pattern.

Answers

Answer:

adding

counting

identifying average

calculating max or min

Explanation:

edg 2021

What value is returned by the call mystery(2, 3, 6)?

answer choices:

9

10

14

8

20

Answers

Answer:

8888888888888888888888888888Explanation:

yyugjhgfgdsfsghgtredfzgxhcjvkiu

Dose anybody know how to do this because i dont.

Answers

Answer:

All you need to explain in this assignment is specific things which makes a product an innovationi or new. This is what emerging means in the first question. Then say why these new technologies can be hard to identitfy.

Explanation:

draw a flowchart to input a number and find out whether it is divisible by 7 or not​

Answers

Note:

% is Modulus,

So it's taken as num mod 7, if that evaluates to 0 there is no reminder therefore divisible by 7.

To print preview a document, navigate to the _____ tab and select the Print option. File Page Design View Insert

Answers

Answer:

Option A

Explanation:

The process of viewing the print preview option in MS word is as follows -

a) First of all click on the File tab

b) After clicking on file tab, click on the print button at the left hand side

c) In the new tab that open up after clicking on the print button will provide an option of print preview.

Hence, option A is correct

Answer:

b. page layout

Explanation:

The decimal equivalent of the product of 1011 and 1100 is

Answers

Answer:

132

Explanation:

We convert each number to base 10 (decimal) and multiply.

So 1011₂ = 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰

= 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1

= 8 + 0 + 2 + 1

= 11₁₀

1100₂ = 1 × 2³ + 1 × 2² + 0 × 2¹ + 0 × 2⁰

= 1 × 8 + 1 × 4 + 0 × 2 + 0 × 1

= 8 + 4 + 0 + 0

= 12₁₀

So, 1011₂ × 1100₂ = 11₁₀ × 12₁₀ = 132₁₀

So, the decimal equivalent of the product of 1011 and 1100 is 132

what is data? why is it important to collect data ? explain the points.​

Answers

Answer:

so i dont know if u mean like science or math but like there similar. so data is the results and information you get when you do experiments. It is important to collect it so it can back up your reasons and points. It also helps us advance and become smarter.

Explanation:

List 5 general safety precautions that you can take when working with a computer equipment.

Answers

Answer:

Wear the right clothes, unplug all equipment, keep your work area clean, check for damaged parts, and do not force components into ports.

Explanation:

These are all general safety precautions when working with computer equipment.

Do you think the benefits outweigh the risks? Why or why not?

Answers

Answer:

Varies By Person. This question is formed to make you think, it's addressed to you. There are no, wrong or right answers. Just needs to be answered with reason to back up your opinion.

Explanation:

Do you think the benefits outweigh the risks? Why or why not?

In my opinion, the benefits always outweigh the risks. This is due to the common nature that the majority of people will view everything in life, every transaction by how much it benefits them. People will also consider what those benefits are. If thing x only has one benefit but it's one I really want, I may take on the 2+, 5+, or 10+ risk that comes with it.

Although that's just my opinion, others may differ, you just need to find your stance.

PLS HELP IM SO DESPERATE!! 40 points


Consider how you would help your Uncle Sandro diagnose the location of the problem and offer a likely solution in the following scenario:

Uncle Sandro has a computer. It is an older model. He calls you in as his tech-savvy nephew and asks if you could help him. It seems like data that is traveling across his computer is getting corrupted, and there is not a clear source. He asks you what the problem is and how he might fix it.

Answers

You would reboot the computer install a VPN and a virus detector

Answer:

1 reboot the computer

2 install a VPN and  virus detector

Explanation:

Any tips or tricks I can use on my phone?​

Answers

Answer:

What phone you got mate? I'm interested

Answer:

No ffrjrirrjj dudjddiejejej

What is one difference between low- and high-level programming languages?
O Low-level programming languages consist of written messages, while high-level programming languages are made up of numerals.
O Low-level programming languages do not have to be translated, but high-level programming languages do.
O Low-level programming languages are more similar to human language than high-level programming languages.
O Low-level programming languages must be interpreted or compiled, but high-level programming languages do not.

Answers

Answer:

Both High level language and low level language are the programming languages’s types.. The main difference between high level language and low level language is that, Programmers can easily understand or interpret or compile the high level language in comparison of machine.

Explanation:

The primary distinction between high-level and low-level languages is that programmers can readily comprehend or interpret humans in high-level languages, but machines can only easily understand humans in low-level languages. Thus, option C is correct.

What low- and high-level programming languages?

Low-level language operands and binary code instructions are swapped out for middle-level language mnemonics. However, since mnemonics are not understood by computers, we must translate them into machine code using a program called Assembler.

The types of programming languages are high level and low level languages. High level languages are distinguished from low level languages primarily by their ease of understanding, interpretation, and compilation by programmers.

Therefore,  Low-level programming languages are more similar to human language than high-level programming languages.

Learn more about programming languages here:

https://brainly.com/question/23959041

#SPJ2

Other Questions
The model shows how the Sun fuses two nuclei of hellum-3 into beryllium-6. Since beryllium-6 is unstable, it will decay into smaller nuclei.What additional product completes the model?O A Helium-4OB Helium-8o C Carbon-4OD Carbon-8 telll me the sauce and youll get a hundred points NEED HELP ASAP Camille runs every morning before school. On Monday, she ran 2.36 miles. On Tuesday, she ran 4.88 miles. On Wednesday, she ran 3.19 miles. After she ran on Thursday, her total mileage for the week was 12.81 miles. How many miles did she run on Thursday? Helppp Ill brainlest.... Daniella earns a 7.5% commission on everything she sells at the electronics store where she works. How much did she earn last week if she sold $3,500 in electronics merchandise The dot plots below show the scores for a group of students for two rounds of a quiz:Two dot plots are shown one below the other. The title for the dot plot on the top is Round 1 and the title for the bottom plot is Round 2. Below the line for each dot plot is written Score. There are markings from 1 to 5 on the line at intervals of one. There are there are 4 dots above the mark 4 and there are 4 dots above the mark 5. For the bottom dot plot there are 2 dots above the mark 1. There are 2 dots above the mark 2, there is 1 dot above the mark 3, there are 2 dots above the mark 4 and there is 1 dot above the mark 5.Which of the following inferences can be made using the dot plots? The range of round 2 is greater than the round 1 range. Round 2 scores are higher than round 1 scores. Round 1 scores are lower than round 2 scores. There is no overlap between the data. Point F is located at (3, 4) on a coordinate plane. If Point F is reflected acrossthe x-axis to create Point F', what will the coordinates of F be? Which three Latin American countries have the most land for livestock raising? In which one of these countries do climate and vegetation make the land most suitable for livestock raising? Why? please help >:(((( Your stomach is growling and your mouth is dry. You just remembered you skipped lunch today. After school you go to the fridge, eat an apple and drink some milk. A. What is the imbalance? B. How did the systems work together to correct the imbalance? C. What is the importance of the circulatory system in the case studies? Part A: How many solutions does the pair of equations for lines A and B have?Explain your answer. (5 points)Part B: What is the solution to the equations of lines A and B? Explain your answer.(5 points Intensity is ___________________a.the lightness or darkness of a color.b.the illumination coming from a light source.c.the brightness or dullness of a color.d.the color's name such as red, yellow, blue.Please select the best answer from the choices providedABCD Why should humans allow nature to take its course or why not? Find the missing side. Round to the nearest tenth when necessary. Chris Evans room is a junkyard is that a metaphor simile oh no much hope you are a idiom On the planet Xenos, an astronaut observes that a 1.00 m long pendulum has a period of 1.50 s. What is thefree-fall acceleration on Xenos? Which of the following correctly arranges the planets by the length of their year in increasing order? A)Venus < Earth < Mars < Saturn B)Saturn < Mars < Earth < Venus C)Mercury < Mars < Earth < Neptune D) Neptune < Earth < Mars < Mercury(please only answer if you know for sure) ASAP pls helps what is 1/2 x 1/4 Help please!!I am in between C or B What impact did the Kansas-Nebraska Act have on slavery? When a nation puts high tariffs on imported or exported goods, it is seen as following a policy of(Choose one) :a) protectionismb) internationalismc) multilateralismd) bilateralism