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
Amiraneli [1.4K]
3 years ago
6

Please use Python 3 to solve the following problem. Please also show all outputs and share code.The variable sentence stores a s

tring. Write code to determine how many words in sentence start and end with the same letter, including one-letter words. Store the result in the variable same_letter_count.Hard-coded answers will receive no credit.sentence = "students flock to the arb for a variety of outdoor activities such as jogging and picnicking"
Computers and Technology
1 answer:
Harman [31]3 years ago
5 0

Answer:

The code is given in Python below with its output.

Explanation:

"""

User is asked to enter the input in sentence

"""

sentence=input("Enter the sentence :")

"""

sentence is converted to list named words

"""

words=sentence.split()

same_letter_count=0

"""

In for loop we access each word

and check character at index 0 and at last index

is same or not.

"""

for word in words:

 if word[0] == word[len(word)-1]:

   same_letter_count+=1

 

print("The same letter count is",same_letter_count)

<u>OUTPUT:: </u>

TEST CASE 1::

Enter the sentence :students flock to the arb for a variety ofoutdoor activities such as jogging and picknicking

The same letter count is 2

TEST CASE 2::

Enter the sentence :i am a bit madam

The same letter count is 3

You might be interested in
When your tire blows out in the middle of a drive, you should _____. A. let go of the steering wheel B. pump the brakes immediat
notsponge [240]
The answer is D. Because you are in the middle of the road so put your caution lights on and steer to the side of the road
3 0
4 years ago
Read 2 more answers
How do you create a reference page in apa format with all websites?
Gre4nikov [31]
Use Cite This For Me's APA citation generator to create a reference page in APA format with all websites.
6 0
3 years ago
Edmund wants to visit his office website. Which software application would he use?
ollegr [7]
He would use a browser!
3 0
4 years ago
Read 2 more answers
Use the worksheet _____ tools in the lower left-hand corner of the Excel screen to scroll through the sheet tabs.
sveta [45]
I think is D ...............
6 0
3 years ago
Read 2 more answers
Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within
Zolol [24]

Answer:

Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within main(), it calls a function called printIt() and passes the income value to printIt().

Explanation:

You will write a flowchart, and C code for a program that does the following:1. Within main(), it asks for the user’s annual income.2. Within main(), it calls a function called printIt() and passes the income value to printIt().  3. The printIt() function evaluates the income, and if the number is over 90000, prints a congratulatory message.  If the income is not over 90000, it prints a message of encouragement, like “You WILL make $50,000, if you keep going.”Here is what the output looks like.File SubmissionUpload your Flowgorithm file, your .c file, and a screen shot of your code output saved in a Word document including the path name directory at the top of the screen into the dropbox for grading.

8 0
3 years ago
Other questions:
  • What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times.
    10·1 answer
  • Renee's creating a plan for her business's information system. What should she do after she determines the goals for her busines
    10·1 answer
  • Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou
    5·1 answer
  • Given the code below, which three statements can be used to create the controller variable?
    5·1 answer
  • Major stress in your life can cause:
    11·2 answers
  • PLS HELP For this activity, you can use the audio recorder on your cell phone or a digital camera to record the following sounds
    14·1 answer
  • 7. Four more than negative eleven times a number is 26.​
    7·2 answers
  • Please use the tables in the flights database. Your deliverable should include a single SQL query that I can run against a "fres
    5·1 answer
  • I am trying to do a python code quiz for school, the basic requirements for the quiz are: the quiz MUST have 10 questions
    15·2 answers
  • I’m select circumstances is a permissible character on the Mac operating system
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!