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
goldfiish [28.3K]
3 years ago
13

The variable sentence stores a string. Write code to determine how many words in sentence start and end with the same letter, in

cluding one-letter words. Store the result in the variable same_letter_count.
Computers and Technology
1 answer:
irina [24]3 years ago
4 0

Answer:

sentence = "hello wow a stores good"

same_letter_count = 0

sentence_list = sentence.split()

for s in sentence_list:

   if s[0] == s[-1]:

       same_letter_count += 1

print(same_letter_count)

Explanation:

*The code is in Python.

Initialize the sentence with a string

Initialize the same_letter_count as 0

Split the sentence using split method and set it to the sentence_list

Create a for loop that iterates through the sentence_list. If the first and last of the letters of a string are same, increment the same_letter_count by 1

When the loop is done, print the same_letter_count

You might be interested in
When comparing alternative methods for making information systems identification and selection decisions, top management's selec
Softa [21]

Answer: b) False

Explanation:

Alternative method that is used for information system consisting of prototyping, outsourcing, end-user development mechanism, system life cycle etc for building a system.

  • These process consist of focusing on user requirement, using high level programming languages, development of prototype,creation of package, database etc instead of cross-sectional phase,selection decisions,top management option etc.
  • Therefore, the correct option is option(b) as the statement is false.
3 0
3 years ago
A program that will ring a bell six times is what kind of program?
amm1812

Answer:

D

Explanation:

because it is a sequence it does more than one thing

6 0
3 years ago
Read 2 more answers
michelle works in retail and cant decide what products to include in the stores front window display. what is the first step she
Nataliya [291]

Correct answer is state the problem

5 0
2 years ago
Read 2 more answers
What happens to formulas with relative cell references when they are copied using the fill handle?
Masteriza [31]
The correct answer is D
4 0
3 years ago
Which statement in main() generates an error?
Sunny_sXe [5.5K]

Answer:

C. leagueName=newPlayers.getLeague(); getLeague() is not a member of Players.

Explanation:

The main method in this code will case an error when trying to run the following line of code...

leagueName=newPlayers.getLeague();

This is because the method getLeague() is being called on a Player object which takes all of its methods from the Player class. Since getLeague() is not a method located in the player class then it cannot be called by an object from that class. Especially since the Player class does not extend to the SoccerPlayers class where the getLeague() method is actually located. Instead, it is the SoccerPlayers class which extends the Players class as its parent class.

3 0
2 years ago
Other questions:
  • It is generally safe to provide your social security number to
    7·2 answers
  • In a program called Nature's Notebook, citizen volunteers make and report observations about seasonal changes in plants and anim
    15·1 answer
  • Having a good credit score is important because:
    7·1 answer
  • Truncation is a keyword search technique that helps you find useful variations of a term or terms. You want to find books on the
    5·1 answer
  • A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time.
    9·2 answers
  • Which CIDR network has the smallest possible number of hosts? a. 123.0.0.0/8 b. 123.45.0.0/16 c. 123.45.67.0/24 d. All have the
    10·1 answer
  • PLS HELP ILL GIVE BRAINLY- (enter the answer) Microsoft _________ is an example of a desktop publishing software
    13·2 answers
  • 6.8 Code Practice<br> please can have some help please
    8·1 answer
  • Use the drop-down menus to explain how to locate the Consolidate dialog box.
    6·1 answer
  • "code is broken down by the computer until it is in _____and is a very long series of ons and offs
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!