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
You just turned on a four port Ethernet switch (it hasn’t learned any addresses yet) and connected a host to each port. You send
butalik [34]

Answer:

Option 2 is correct.

Explanation:

When the user recently switched over that port Ethernet device, which is, no addresses have yet been acquired as well as a client has been linked on each port. He sends #1 packet from 00:11:22:33:44:55 to 66:77:88:99:00:11 arriving at the device's port 1. Next packet #2 is transmitted between 22:33:44:55:66 to 00:11:22:33:44:55 that appears at the switch's port 3.

So that the Package # 2 will be sent only through port 1 by the user who switched over the network.

7 0
3 years ago
How do you stop getting emails from brainly saying "sarah from brainly has answered your question"
Alina [70]

Answer:

One best way to prevent from getting some emails from Brainly that are a bit annoying when you get there notifications from there, here are some ways you can get rid of those notifications below;

At the More options icon you can press it and if you see the word unsubscribe you can press it. The picture above shows a part of the instruction. This more options icon is :

At the More options icon you can also press block and you will no longer receive a notification from this app. thats the best i can do Explanation:

3 0
2 years ago
What should you do before you share your information on the Internet? A. Ask a trusted adult to make sure it is safe. B. Check t
lora16 [44]

There are some websites that are trustworthy. For instance just beside the address bar there will be a lock. You can scroll over it with your mouse to see if it states that it is a secure connection.

Virus protection if accountable should also advise whether website is safe or not.

Always scroll down to the bottom of the page and check their security sites, as in McAfee, Norton, Etc.

The answer is D: Read the website thoroughly!!!!

Always be skeptical and reluctant, as technology advances, so do hackers and online criminals. People are far too brave and crazy these days.

Most bank accounts offer some type of an additional account you can use for online transactions. For instance you may have a checking that you have to pay your bills with (keep your bill money, etc in the account not being used online). Then they may offer another type of account, my  bank refers it to an eaccess account, This is where I can use their online app to transfer money, through my bank app, for online purchases only. Therefore if someone has my account information they aren't getting access to my money that is an absolute necessity, just the little online purchase at a time one, that is also FDIC insured and after a dispute you will be reimbursed in due time.

Another option is PayPal, Paypal actually has a cash debit card now that makes life so much easier when paying. Using paypal pay they only have access to a prepaid debit card.

5 0
3 years ago
Choose the word that best completes this sentence. ____________ should cover every part of the worksite.
Evgen [1.6K]
Since you provide no choices, here are several things that should cover every part of the worksite :
- Emergency exit
- Safety measures

Hope this helps
5 0
3 years ago
Read 2 more answers
Software (often on firmware) designed to make physical products and devices "smarter" by doing things like sharing usage informa
kolezko [41]

Answer:

embedded system

Explanation:

Based on the scenario being described within the question it can be said that the type of software that is being described is known as an embedded system. This is actually a combination of both hardware and software that focuses on a specific function which is later implemented into a much larger system to allow it to become "smarter", by performing more complex tasks, which would otherwise not be possible.

5 0
3 years ago
Other questions:
  • Which item refers to an illusion of figures and shapes in motion, which we commonly see in movies and video games?
    9·1 answer
  • Consider the provided C++ code in the main.cpp file: The function func2 has three parameters of type int, int, and double, say a
    8·1 answer
  • How to do pseudocode and flowchart in BMI ( computer programming ​
    11·1 answer
  • Why when i click home on iphone i still at my grandma house
    11·2 answers
  • Green Field county stadium is planning to conduct a cricket match between two teams A and B. A large crowd is expected in the st
    6·1 answer
  • Why is it difficult to convince top management to commit funds to develop and implement a Strategic Information System
    13·1 answer
  • D) Informal high level descuption of an algorithm in english kcalled
    9·2 answers
  • What does a coder do on a daily basis?
    8·1 answer
  • Explain how you think robotics plays a part in the subway driver's job.
    13·2 answers
  • In what way, if any, is the impact of a given risk affected by the timing of a project?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!