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
Which of the following does not describe local alignment algorithm?
swat32

Answer:

The answer is "Option a".

Explanation:

A score can be detrimental. When an element has a score below zero, it means, that the sequences up to this point have no correlations, that are set to zero and its effects the previous alignment is excluded. Thus, alignment can be further found in every position later in the calculation. and other options are incorrect that can be described as follows:

  • In option b, In this option the score can be negative, that's why we can't set its value.
  • In option c, The first row and column must contain some value it can't be 0, that's why it is not correct.
  • In option d, It will start with a lower score and ends with a higher score, that's why it is not correct.

8 0
3 years ago
What types of actions exist in activity diagrams?<br>​
iragen [17]

Answer:

Activity Diagrams

Activity. An activity diagram illustrates one individual activity. ...

Action. ...

Calling an Activity (Action) ...

Accepting an Event (Action) ...

Accepting a Time Event (Action) ...

Sending Signals (Action) ...

Edge (Control Flow) ...

Decision Node.

Explanation:

8 0
3 years ago
Please help it's on scratch coding !
NeTakaya

True, you can because in Scratch, you actually can use an if statement block and use an if touching another sprite.

5 0
2 years ago
Read 2 more answers
Hola, disculpa me podrías ayudar enviándome una captura dándole like a este video? Por favor, es un proyecto escolar en el que e
PtichkaEL [24]

Answer:

Una captura de pantalla es una instantánea de la pantalla de un dispositivo informático, como un teléfono o una computadora. Mantenga presionado el botón de encendido y el botón de columna hacia abajo para tomar una captura de pantalla en teléfonos inteligentes.

Explanation:

Una captura de pantalla de la pantalla de un dispositivo de computadora es como tomar la foto de una pantalla. Para los teléfonos inteligentes, presionar la columna hacia abajo y el botón de encendido tomaría la instantánea del teléfono.

Para darle Me gusta a un video en una plataforma de redes sociales, simplemente haga clic en el ícono de pulgar hacia arriba.

6 0
3 years ago
Provide an example by creating a short story or explanation of an instance where confidentiality would be broken.​
Reil [10]

Explanation:

Personal Insurance

Confidentiality in the workplace: What you need to know

When you give advice to clients or patients for a living, you'll know that protecting sensitive and personal information is crucial. But are you clear on what counts as a breach of confidence or what to do if one occurs?

From how to protect confidential information, to what breaches of confidence look like for different jobs, here's what you need to know about confidentiality in the workplace.

What is a breach of confidentiality?

In short, a confidentiality breach is the disclosure of information to someone without the consent of the person who owns it. In other words, failing to respect a person's privacy or the confidence in which they gave the information or data to you, by passing it onto someone else.

Why is confidentiality important?

Protecting confidential information is vital. If you're in a position where you have access to or are given this type of data at work, your career relies on your ability to keep patient or client confidentiality. If you don't, you could lose trust and integrity in the eyes of your existing (and potential future) clients, who could terminate your contract and take legal action against you.

Therapist/patient confidentiality

Unsurprisingly, patient confidentiality is highly important for therapists and counsellors. It forms part of the therapeutic frame of appropriate boundaries, which creates a safe space for a good working relationship to form.

Here’re some examples of ways you could unintentionally break patient/therapist confidentiality:

Sharing confidential information about a client with a family member or friend

Talking about confidential information somewhere you can be overheard

Leaving your computer containing confidential information open to others

Continuing to work with a client when there's a conflict of interests (for example, they know one of your family members or friends)

When permission to share information is given but isn't specific, this can create confusion and result in a potential breach (for example, a patient may give permission for their information to be shared with a teacher but not their GP)

7 0
4 years ago
Other questions:
  • Where is help on this system?
    7·2 answers
  • 2
    9·2 answers
  • Which of the following can a cell contain?
    7·2 answers
  • I'd: 9872093250, password: qqqqq, join the meeting​
    11·1 answer
  • Which shooting games is good for low end PC. CSGO or Valorant?​
    11·1 answer
  • I don't want my large video files using up all my hard drive space . Can I archive my videos in on DVDs or Blu Rays?
    8·1 answer
  • What is an example of a one-to-many relationship?
    9·2 answers
  • I have no idea how to use the sep and end in Python can someone help me I have a test tomorrow
    13·1 answer
  • Anyone have some good animes to watch, i finished haikyuu, BNHA, Kakegurui, and a whisker away -.-
    13·2 answers
  • Mr. stevens is the principal of a high school. why might he want to export data from a database of students’ exam scores? to cre
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!