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
worty [1.4K]
3 years ago
5

In English there are five vowel letters in the alphabet: A, E, I, O, U. For the purposes of this exercise we won't count Y as a

vowel. Write a program that takes a line of text as input and outputs the number of vowels in the words. Make sure to account for both uppercase or lowercase. You are encouraged to write functions and test code in IDLE before submitting your solutions here.
Computers and Technology
1 answer:
Vikki [24]3 years ago
3 0

Answer:

s = input("Enter a sentence: ")

count = 0

for c in s:

 if "AEIOU".find(c.upper()) >= 0:

   count = count + 1

print ("There are %d vowels." % (count))

Explanation:

Just for fun, here is a super short one using regex:

import re

s = input("Enter a sentence: ")

print ("There are %d vowels." % len(re.findall("[aeiou]",s.lower())))

You might be interested in
Write a program that uses nested loop or for statements to display Pattern A below, followed by an empty line and then another s
JulsSmile [24]

Answer:

public class Pyramid {

   public static void main(String[] args) {

             int h = 7;

       System.out.println("Pattern A");

               for(int i = 1; i <= h; ++i)

               {

                   for(int j = 1; j <= i; ++j) {

                       System.out.print("+");

                   }

                   System.out.println();

               }

       System.out.println();

       System.out.println("Pattern B");

               for (int i = 1; i<=h; ++i)

               {

                 for(int j = h; j >=i; --j){

                     System.out.print("+");

                 }

                   System.out.println();

               }

           }

       }

Explanation:

  • The trick in this code is using a nested for loop
  • The outer for loop runs from i = 0 to the heigth of the triangle (in this case 7)
  • The inner for loop which prints the (+) sign runs from j = 0 to j<=i
  • It prints the + using the print() function and not println()
  • In the pattern B the loop is reversed to start from  i = height
8 0
3 years ago
The function below takes a single parameter number_list which is a list that can contain integers and floats. Complete the funct
Andreas93 [3]

Answer:

  1. def getLargest(number_list):
  2.    new_list = []
  3.    for x in number_list:
  4.        if(isinstance(x, int)):
  5.            new_list.append(x)
  6.    largest = max(new_list)
  7.    return largest  

Explanation:

Firstly, create a function <em>getLargest()</em> that take one input parameter, <em>number_list</em>.

The function will filter out the float type number from the list by using <em>isinstance() </em>method (Line 5). This method will check if a current x value is an integer. If so, the x value will be added to <em>new_list</em>.

Next, use Python built-in <em>max</em> function to get the largest integer from the <em>new_list </em>and return it as output.

6 0
3 years ago
What offers backup services that use cloud resources to protect applications and data from disruption caused by disaster? Multip
sattari [20]

Answer:

The correct answer to the following question will be "Disaster Recovery as a Service (DRaaS)".

Explanation:

DRaaS seems to be a cloud services term used only to secure an infrastructure or data through human catastrophe or interruption of service at any destination by allowing a complete recovery throughout the cloud.

  • DR seems to be a security or management preparation field which seeks to protect an organisation from those in the consequences of major negative experiences.
  • This provides offsite backups which use storage resources to defend programs including assets from disaster-induced destruction.

8 0
3 years ago
When presentations are being shown to an audience of over fifty people, how they should be displayed?
Anarel [89]
Full screeennn !!!!!!
6 0
3 years ago
Read 2 more answers
Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolut
STALIN [3.7K]

Solution :

x = float_(input())

y = float_(input())

z = float_(input())

res1 = x**z

res2 = x**(y**z)

res3 = abs(x-y)

res4 = (x**z)**0.5

print('{:.2f} {:.2f} {:.2f} {:.2f}'.format(res1,res2,res3,res4))

Output is :

5.0

1.5

3.2

172.47 361.66 3.50 13.13

6 0
2 years ago
Other questions:
  • In Linux Operating System, what file extension is used forexecutable files?
    6·1 answer
  • The following code is intended to test if x is NOT less than 17. Fill in the correct symbol:
    14·2 answers
  • You are an interior decorator, confronted with a dark living room. To lighten the room up, you have n candles and want to build
    12·1 answer
  • Which version of Windows was considered an operating environment rather than an operating system? Windows 1.0 Windows 3.0 Window
    9·1 answer
  • What is the best information to include in the template name to differentiate it from other templates? Check all that apply.
    6·1 answer
  • Why are ethics important in PR?
    8·1 answer
  • What happens if you have you an image that has 6 bits-per-pixel and you change it to 12
    6·1 answer
  • (1)similarities between backspace key and delete key. (2) different between backspace key and delete key. (3) explain the term e
    10·1 answer
  • What does Al stand for?
    10·1 answer
  • Find out about the different technological solutions available for interconnecting LANs to from larger networks such as wide are
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!