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
dsp73
3 years ago
5

Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times

the character appears in the phrase.
Computers and Technology
1 answer:
shusha [124]3 years ago
6 0

Answer:

The program in Python is as follows:

print("Enter a character followed by a phrase",end='')

word = input(": ")

char = word[0]

print("Occurrence: "+str((word.count(char))-1))

Explanation:

The prints an instruction to the user on how to input to the system

print("Enter a character followed by a phrase",end='')

This prompts and gets the user for input

word = input(": ")

This extracts the character from the input string

char = word[0]

This counts and prints the number of occurrence of the extracted character

print("Occurrence: "+str((word.count(char))-1))

You might be interested in
What number system is the basis for all of the powerful computers and electronic devices in the world?
labwork [276]

Answer:

Binary

Explanation:

3 0
3 years ago
What are general purpose computer and special purpose computer?​
icang [17]

Answer:

General purpose computers are designed to be able to perform variety of tasks when loaded with appropriate programs, while special purpose computers are designed to accomplish a single task.

3 0
3 years ago
Read 2 more answers
PLEASE HELP ME
alexira [117]

Answer:

it won't be able to run

Explanation:

because computer runs on physical memory

5 0
2 years ago
Pros and cons of using the internet
MAVERICK [17]
It is easy to find information, but it is not always right.
7 0
3 years ago
Read 2 more answers
Which three are functions of the operating system?
Stels [109]

Answer:

An operating system has three main functions: (1) manage the computer's resources, such as the central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3) execute and provide services for applications software.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Very often in data science, we are interested in understanding how values change with time. Use np.diff and np.max (or just max)
    13·1 answer
  • A network in which communication passes from one person to another in a sequential pattern rather than being shared among member
    6·2 answers
  • When driving a truck is fuel crucial
    9·1 answer
  • Difference between softcopy and hardcopy​
    8·2 answers
  • What is used to determine when the communications channels are clear and when a device is free to transmit data
    6·1 answer
  • Storage device that is installed inside your computer is called?
    7·1 answer
  • The following is a mock-up of a Battleship game board. The square with a X marks the position of a battleship.
    13·1 answer
  • Debug the code in the main method of this class, which is intended to initialize an array named arr to hold 3 ints, fill this wi
    15·1 answer
  • As a student, why do you need to know and follow the steps printing a <br><br>document?​
    6·2 answers
  • Ang Kabihasnang ito ay umusbong sa rehiyon ng Timog Mexico
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!