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
gladu [14]
4 years ago
15

mystery_string = "Hello! What a fine day it is today." mystery_character = "a" #------------------------------------------------

----------- #You may modify the lines of code above, but don't move them! #When you Submit your code, we'll change these lines to #assign different values to the variables. #Write some code below that will count and print how many #times mystery_character appears in mystery_string. You may #not use the string class's .count method. # #With the original values for mystery_string and #mystery_character, your code should initially print 4. Only #count characters with the same case as mystery_character #(in other words, here you would ignore capital A). #Add your code here!

Computers and Technology
1 answer:
PtichkaEL [24]4 years ago
8 0

Answer:

Here is the Python code:

mystery_string = "Hello! What a fine day it is today."

mystery_character = "a"

counter = 0

for i in range(len(mystery_string)):  

   if (mystery_string[i] == mystery_character):

       counter+=1

print (counter)  

                             

Explanation:

The above program has two variables mystery_string which contains the string Hello! What a fine day it is today and mystery_character which contains character a. The program counts and prints the number of times character a appears in the string.

It has a counter variable to store the number of times mystery_character appears in the mystery_string.

The loop has a variable i that moves through the mystery_string character by character and the loop continues to execute till i reaches the length of the mystery_string. If the character at position i is equal to the mystery_character, then counter variable counts it and increments its value to 1 each time the mystery_character is found in the mystery_string.

When the loop terminates it finally returns the number of times mystery_character appears in the mystery_string.

The screenshot of the program along with its output is attached.

You might be interested in
Which type of evaluation requires that the program be fully implemented before the evaluation can begin
Drupady [299]

Answer:

Around the world, there exist many programs and interventions developed to improve conditions in local communities. Communities come together to reduce the level of violence that exists, to work for safe, affordable housing for everyone, or to help more students do well in school, to give just a few examples.

But how do we know whether these programs are working? If they are not effective, and even if they are, how can we improve them to make them better for local communities? And finally, how can an organization make intelligent choices about which promising programs are likely to work best in their community?

Over the past years, there has been a growing trend towards the better use of evaluation to understand and improve practice.The systematic use of evaluation has solved many problems and helped countless community-based organizations do what they do better.

Explanation:

<em>Despite an increased understanding of the need for - and the use of - evaluation, however, a basic agreed-upon framework for program evaluation has been lacking. In 1997, scientists at the United States Centers for Disease Control and Prevention (CDC) recognized the need to develop such a framework. As a result of this, the CDC assembled an Evaluation Working Group comprised of experts in the fields of public health and evaluation. Members were asked to develop a framework that summarizes and organizes the basic elements of program evaluation. This Community Tool Box section describes the framework resulting from the Working Group's efforts.</em>

<em>Despite an increased understanding of the need for - and the use of - evaluation, however, a basic agreed-upon framework for program evaluation has been lacking. In 1997, scientists at the United States Centers for Disease Control and Prevention (CDC) recognized the need to develop such a framework. As a result of this, the CDC assembled an Evaluation Working Group comprised of experts in the fields of public health and evaluation. Members were asked to develop a framework that summarizes and organizes the basic elements of program evaluation. This Community Tool Box section describes the framework resulting from the Working Group's efforts.Before we begin, however, we'd like to offer some definitions of terms that we will use throughout this section.</em>

<em>By evaluation, we mean the systematic investigation of the merit, worth, or significance of an object or effort. Evaluation practice has changed dramatically during the past three decades - new methods and approaches have been developed and it is now used for increasingly diverse projects and audiences.</em>

<em>By evaluation, we mean the systematic investigation of the merit, worth, or significance of an object or effort. Evaluation practice has changed dramatically during the past three decades - new methods and approaches have been developed and it is now used for increasingly diverse projects and audiences.Throughout this section, the term program is used to describe the object or effort that is being evaluated. It may apply to any action with the goal of improving outcomes for whole communities, for more specific sectors (e.g., schools, work places), or for sub-groups (e.g., youth, people experiencing violence or HIV/AIDS). This definition is meant to be very broad</em>

<h2><em>I</em><em> </em><em>HOPE</em><em> </em><em>THIS</em><em> </em><em>HELPS</em><em> </em><em>YOU</em><em> </em><em>ALOT</em><em> </em><em>THANKS</em><em>!</em></h2>
5 0
3 years ago
To place the caption at the top of the image, you will need to change the __________ in the
dsp73
You have to change the options
4 0
4 years ago
Read 2 more answers
When you boot up a computer and hear a single beep, but the screen is blank, what can you assume is the source of the problem?
olchik [2.2K]
Either your screen isnt plugged in and synced properly or you have a problem in the automatic boot system 
5 0
4 years ago
Read 2 more answers
How many frequencies does a full-duplex qam-64 modem use?
Vsevolod [243]

The answer is 2 frequencies.

A Full-Duplex QAM 64 K Modem uses two frequencies. One frequency is used for upstream and the other for downstream. A variety of common QAM forms are available and include, 16 QAM, 32 QAM, 64 QAM, and 256 QAM. For example, for domestic broadcast use, 64 and 256 QAM are used for cable modem and digital cable TV. The modulation scheme for this modem uses both amplitude and phase.

8 0
4 years ago
Read 2 more answers
Maeve has created the website, but she is not able to include more than one blank space at a time. Even if she hits the SPACE bu
GenaCL600 [577]

Answer:

For the browser to display multiple spaces, Maeve must use &nbsp; in her code to create more spaces.

Explanation:

&nbsp; is known as hard space or fixed space. NBSP stands for Non-Breaking Space. The statement will continue without breaking into another line.

Maeve can easily use the &nbsp; many times to get the required space she needs.

5 0
4 years ago
Other questions:
  • TLO 06 Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure.a. Trueb. False
    14·1 answer
  • Which relationship is possible when two tables share the same primary key? one-to-one one-to-many many-to-one many-to-many
    15·2 answers
  • What is one of the differences between Random Access Memory (RAM) and Read Only Memory (ROM)? RAM is where files are stored, and
    6·2 answers
  • 6. Why did he choose to install the window not totally plumb?
    13·1 answer
  • A ____________ is a network connection that typically carries encrypted data over the Internet to and from a remote access serve
    13·1 answer
  • Join my discord server! CODE IS (CebjBXN)​
    12·2 answers
  • What happens if none of the selector values match selector in a simple case expression in pl/sql
    6·1 answer
  • What will the following code display? int numbers[4] = { 99, 87 }; cout &lt;&lt; numbers[3] &lt;&lt; endl; a. 87 b.0 d. 34. What
    12·1 answer
  • Copy and paste is the only way to move text from one place to another.<br><br>True or <br>False​
    15·2 answers
  • Please help I will mark brainliest
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!