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
zaharov [31]
3 years ago
14

Write a program with a function that accepts a string as an argument and returns the number of uppercase, lowercase, vowel, cons

onants, and punctuation that the string contains. The application should let the user enter a string and should display the number of uppercases, lowercases, vowels, consonants, and punctuations that the string contains.
Computers and Technology
1 answer:
diamong [38]3 years ago
8 0

Answer:

Explanation:

The following code is written in Python. It is a function called checkString that takes in a string as an argument and loops through each char in that string and checking to see if it is lowercase, uppercase, vowel, consonant, or punctuations. It adds 1 to the correct variable. At the end of the loop it prints out all of the variables. The picture below shows a test output with the string "Brainly, Question."

def checkString(word):

   uppercase = 0

   lowercase = 0

   vowel = 0

   consonants = 0

   punctuation = 0

   vowelArray = ['a', 'e', 'i', 'o','u', 'y' ]

   consonantArray = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']

   punctuationArray = ['.', '!', '?', ',', ';', '(', ')']

   for char in word:

       if char.isupper():

           uppercase += 1

       else:

           lowercase += 1

       if char.lower() in vowelArray:

           vowel += 1

       elif char.lower() in consonantArray:

           consonants += 1

       if char in punctuationArray:

           punctuation += 1

   print('Uppercase: ' + str(uppercase))

   print('Lowercase: ' + str(lowercase))

   print('Vowels: ' + str(vowel))

   print('Consonants: ' + str(consonants))

   print('Punctuations: ' + str(punctuation))

You might be interested in
PLEASE HELP ASAP!!! Prompt<br> What is the Bcc address field for?
cluponka [151]

Answer:

For security and privacy reasons, it is best to use the Blind Carbon Copy (BCC) feature when sending an email message to a large number of people. When you place email addresses in the BCC field of a message, those addresses are invisible to the recipients of the email.

Explanation:

8 0
3 years ago
The Leader Motive Profile (LMP) includes a: a. high need for power. b. low need for achievement. c. moderate need for power. d.
algol [13]

Answer:

a. is correct

Explanation:

6 0
3 years ago
Ed wants to make sure that his system is designed in a manner that allows tracing actions to an individual. Which phase of acces
tatiyna

The phase of access control that one can say that Ed is more concerned about is called Accountability.

<h3>What is accountability?</h3>

Accountability is known to be one that removes the time and effort you that is used on distracting activities and a lot of unproductive behavior and it makes one to be more focused.

Hence, The phase of access control that one can say that Ed is more concerned about is called Accountability.

Learn more about Accountability from

brainly.com/question/27958508

#SPJ1

7 0
2 years ago
How many base cases are in the functionabove?
baherus [9]

Answer:

The answer is (b). 1.

Explanation:

In the code there is only 1 base case .

the base case is as following:-

if(n==0)

return 0;

this is the base case.

Base case is the most important statement in the function that uses recursion because without base case the recursion calls will keep on going and we will get a run time error.

5 0
3 years ago
How has social media and the workplace affected you?
MAVERICK [17]

Answer and Explanation:

Social Media keeps on developing, as do the discourses in regards to its application inside the domain of business and learning.

There are different translations of online life, regardless of whether it is explicit to systems administration and web 2.0 innovations or ranges the utilization of any current innovation that improves social connections.

Social media, in any case, has numerous advantages to business, particularly the obvious head-ways in joint effort and correspondence.

As the innovation of social media keeps on changing and develop in notoriety, organizations should think about techniques to use its utilization in the work environment.

5 0
3 years ago
Other questions:
  • Wharton professor Jerry Wind "believe[s] that digital networks are the key differentiator, [and] enable new forms of sharing, di
    9·1 answer
  • Reputable firms often ask recent graduates to pay an up-front fee for a job.
    10·2 answers
  • _____ refers to unsolicited commercial emails, usually sent to a large number of people with little regard to the users interest
    14·1 answer
  • Your grandmother was an established artist and left you several original paintings after she died. Which of these statements is
    11·1 answer
  • What are the different types of firewalls? Which one is best?
    5·1 answer
  • How many of you got the right answer from this app​
    8·1 answer
  • Complete the sentence about entering and editing data in a cell in a spreadsheet.
    13·1 answer
  • It destructs microorganisms in containers
    8·1 answer
  • 6. A genre of video game in which a player chooses a character and builds, upskills and modifies that character is referred to a
    12·2 answers
  • Government entities may pressure upstream Internet service providers to _____. a. track and monitor the Internet activities of i
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!