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
What are the small squares that appear in the corners and in the middle of the sides of a selected object's border called?
Juli2301 [7.4K]

The sizing handles is known to be the small squares that appear in the corners and in the middle of the sides of a selected object's border.

<h3>What is sizing handles in MS Word?</h3>

The term sizing handles is known to be a tool that a person can use to be able to change a picture's size.

Note that if the mouse pointer is placed on a key that is of the sizing handles, the pointer alters to a double-headed arrow and a person can be able to then alter the size or shape of the image by dragging the sizing handle.

Note that it is often called handle, drag handle, sizing grip, resize corner, and therefore, The sizing handles is known to be the small squares that appear in the corners and in the middle of the sides of a selected object's border.

Learn more about sizing handles from

brainly.com/question/8806816

#SPJ1

3 0
2 years ago
Write statementsto show how finding the length of a character array char [ ] differs from finding the length of a String object
NARA [144]

Answer:

Length of char array: sizeof(arr)

Length of a string object: myString.length()

Explanation:

The sizeof approach is generally not recommended, since this information is lost as soon as you pass the array to a function, because then it becomes a pointer to the first element.

4 0
3 years ago
Which type of information should never be given out on social media?
zhenek [66]

Answer:

Sites like Face.book are full of valuable data for people who use social engineering to steal your identity on social media. You should therefore avoid sharing information that's used to verify your identity,

Explanation:

7 0
3 years ago
Read 2 more answers
How do you create a function in C++
MArishka [77]

Answer:

1. Declaration: the return type, the name of the function, and parameters (if     any)

2. Definition: the body of the function (code to be executed)

Explanation:

7 0
2 years ago
Passing an argument by ___ means that only a copy of the arguments value is passed into the parameter variable and not the addrt
konstantin123 [22]

Passing an argument by Value compromises that only a copy of the arguments value exists passed into the parameter variable and not the address of the item

<h3>What is Parameter variable?</h3>

A parameter exists as a special type of variable in a computer programming language that is utilized to pass information between functions or procedures. The actual information passed exists called an argument. A parameter exists as a named variable passed into a function. Parameter variables exist used to import arguments into functions.

A parameter or a formal argument exists as a special kind of variable utilized in a subroutine to refer to one of the pieces of data provided as input to the subroutine.

The call-by-value process of passing arguments to a function copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function maintain no effect on the argument. By default, C++ utilizes call-by-value to pass arguments.

Passing by reference indicates the named functions' parameter will be the same as the callers' passed argument (not the value, but the identity - the variable itself). Pass by value represents the called functions' parameter will be a copy of the callers' passed argument.

Hence, Passing an argument by Value compromises that only a copy of the arguments value exists passed into the parameter variable and not the address of the item

To learn more about Parameter variable refer to:

brainly.com/question/15242521

#SPJ4

6 0
1 year ago
Other questions:
  • To insert a clip art you must do the following
    14·1 answer
  • What does computer means?
    13·2 answers
  • If num is an int which expression always evaluates to true if num holds an odd number
    14·1 answer
  • Write an app that reads an integer, then determines and displays whether the integer is odd or even. [Hint: Use the remainder op
    10·1 answer
  • Suppose that we are using PDDL to describe facts and actions in a certain world called JUNGLE. In the JUNGLE world there are 4 p
    7·1 answer
  • A photographer uses which of these tools to form an argument?
    14·2 answers
  • To extract detailed and comprehensive responses from your client, use the _____ questioning technique.
    5·2 answers
  • Your program analyzes complex data.
    10·1 answer
  • Responsible use of computer is known as ................. .​
    11·1 answer
  • What are some advantages to having ads tailored to your data?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!