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
Minchanka [31]
3 years ago
9

Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in

the string. The output should include the input character and use the plural form, n's, if the number of times the characters appears is not exactly 1. g
Computers and Technology
1 answer:
Zielflug [23.3K]3 years ago
7 0

Answer:

The program in Python is as follows:

string = input("String: ")

chr = input("Character: ")[0]

total_count = string.count(chr)

print(total_count,end=" ")

if total_count > 1:

   print(chr+"'s")

else:

   print(chr)

Explanation:

This gets the string from the user

string = input("String: ")

This gets the character from the user

chr = input("Character: ")[0]

This counts the occurrence of the character in the string

total_count = string.count(chr)

This prints the total count of characters

print(total_count,end=" ")

If the count is greater than 1

if total_count > 1:

Then it prints a plural form

   print(chr+"'s")

If otherwise

else:

Then it prints a singular form

   print(chr)

You might be interested in
What command will unregister a component when run?
Advocard [28]
<span>Regsvr32.exe/u will unregister a component when run. Regsvr32.exe/u is a utility tool that is installed on Windows Xp or later versions of Windows. It has a 32-bit version and 64-bit version which can be found in the system root folder on a computer. It is capable of unregistering servers.</span>
7 0
3 years ago
Read 2 more answers
Once jaden has decided upon the telecommunications technology his team will use, he will have completed the last step of the dec
mrs_skeptik [129]
<span>Once Jaden has decided upon the telecommunications technology his team will use, he will have completed the last step of the decision-making process. TRUE.</span>
6 0
4 years ago
Step into the year 2028. How are people viewing digital video? Or have we moved on to a completely new format?
WINSTONCH [101]

In the year 2028 I don't believe our digital video viewing experience would change too much considering most, if not all, the population is already satisfied with how easy, simple, and versatile our current experience is. If everything changes one thing will for sure remain unchanged. That one thing is cinemas, I don't think cinemas will ever change much as they provide a constant source of revenue while providing a place for family and friends to get together to watch a movie before it becomes available to other sources.


8 0
3 years ago
After sending input in the Chinese language to an AI system, Nina got numerous translations in the English language. Which chall
ad-work [718]

Answer:

i think its translation complexity

Explanation:

8 0
3 years ago
Help please and thank you :)
Fynjy0 [20]
Answer:First one net is the answer ........
5 0
3 years ago
Other questions:
  • Which of the acronyms listed below refers to a series of basic hardware diagnostic tests performed by the startup BIOS after the
    13·1 answer
  • Tell me the shortcut keys used in Ms PowerPoint ?​
    6·2 answers
  • Given an list of N integers, Insertion Sort will, for each element in the list starting from the second element: Compare the ele
    8·1 answer
  • What do you believe are the motives of a cyber criminal? Why?
    15·1 answer
  • 1.where should the name of the website or company logo appear on a website
    5·2 answers
  • Word processing programs have different view options that you can use depending on the tasks your performing
    5·1 answer
  • Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he'd like to learn if
    9·2 answers
  • Logical design is tied to a specific hardware and software platform. a. True b. False
    9·1 answer
  • Mrs. Dunn shows her students a data range, which has been named "Goals," covering cells A14 to A25. She tells her students that
    15·1 answer
  • Jackie created a poster for a rock band. Which file format will best preserve the graphics? 20PTS​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!