Question

For python 3.7. This should only be a few lines if any, but for some reason...

For python 3.7. This should only be a few lines if any, but for some reason I can't get it.

Given the string line, create a set of all the vowels in line. Associate the set with the variable vowels.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
vowels = set()
for x in line:
    if x in "aeiouAEIOU":
        vowels.add(x)

Add a comment
Know the answer?
Add Answer to:
For python 3.7. This should only be a few lines if any, but for some reason...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python 3.7 Coding assignment This Program should first tell users that this is a word analysis...

    Python 3.7 Coding assignment This Program should first tell users that this is a word analysis software. For any user-given text file, the program will read, analyze, and write each word with the line numbers where the word is found in an output file. A word may appear in multiple lines. A word shows more than once at a line, the line number will be only recorded one time. Ask a user to enter the name of a text file....

  • 3. GRAPH ONLY. Label axes, lines and equilibrium points. Explain briefly the reason any line shifts....

    3. GRAPH ONLY. Label axes, lines and equilibrium points. Explain briefly the reason any line shifts. The US is close to full employment, when we go into a severe recession (unemployment is approaching 12%). Congress decides to save US jobs by imposing high tariffs on all foreign goods. Because rest of the world retaliates, our next exports are unchanged, although the level of imports and exports has decreased. Unemployment increases and exchange rates remain the same. A PPC curve, exchange...

  • ** Language Used : Python ** PART 2 : Create a list of unique words This...

    ** Language Used : Python ** PART 2 : Create a list of unique words This part of the project involves creating a function that will manage a List of unique strings. The function is passed a string and a list as arguments. It passes a list back. The function to add a word to a List if word does not exist in the List. If the word does exist in the List, the function does nothing. Create a test...

  • Write a C program to “de-vowel” an input string. Assume that the user provides input containing...

    Write a C program to “de-vowel” an input string. Assume that the user provides input containing only the characters a through z (i.e., all lowercase letters). Your program should create an output string that deletes all vowels from the input string, pushing the letters together to fill any gaps. For example, given the input “theturtleandthehare” your code should print out “thtrtlndthhr”. Your program should create an output string from the input string, before printing its output. Sample Input: Enter a...

  • Write a program that determines if a string (passed as a command-line argument) has all unique...

    Write a program that determines if a string (passed as a command-line argument) has all unique characters. The program must print the number of times each existing character appears, and then print whether or not they are all unique. Special requirements: You are NOT allowed to modify the input string or create any additional data structures (no arrays, lists, dictionaries, or other strings). You may have only one string (the one received as the command-line argument). You may have one...

  • Write a program that reads in a text file, infile.txt, and prints out all the lines...

    Write a program that reads in a text file, infile.txt, and prints out all the lines in the file to the screen until it encounters a line with fewer than 4 characters. Once it finds a short line (one with fewer than 4 characters), the program stops. For your testing you should create a file named infile.txt. Only upload your Python program, I will create my own infile.txt. Please use a while-loop BUT do not use break, Exit or Quit...

  • I want to use BING API for web searching using python. Search result should only contain PDF. I a...

    I want to use BING API for web searching using python. Search result should only contain PDF. I added the advanced operator (filetype: pdf) in the search query. But seems it not working. ******** Python code ************** import requests def bing_search(query): url = 'https://api.cognitive.microsoft.com/bing/v5.0' # query string parameters payload = {'q': query, 'filetype':'pdf','responseFilter':'Webpages'} # custom headers headers = {'Ocp-Apim-Subscription-Key': '9126a2280100424b90b85d764a18dc34'} # make GET request r = requests.get(url, params=payload, headers=headers) # get JSON response return r.json() j = bing_search('Machine Learning') print(j.get('webPages',...

  • for python, i have some ideas on how to approach it but not sure. any suggestions...

    for python, i have some ideas on how to approach it but not sure. any suggestions help! thank you. 4 is sorted (head) This function takes a single parameter, which is a list, and returns True or False, indicating whether or not the values in the list are sorted. Note that duplicates may exist in the list; these count as being in order. An empty list should return True. I 5 list sum(head) This function takes a single parameter, which...

  • Python   #complete the following lines of code wherever indicated. 5 question 20 points a piece #you...

    Python   #complete the following lines of code wherever indicated. 5 question 20 points a piece #you may use your book and internet but no form of messaging or communication #QUESTION 1 #Read in the file exam_file.txt #Print to the console every other line #QUESTION 2 #Read in exam_file.txt #split file into words #write to a file called question2.out that contains 1 word per line (words can occur more than once) #QUESTION 3 # Print out all the Middle Initials in...

  • Python #complete the following lines of code wherever indicated. 5 question 20 points a piece #you...

    Python #complete the following lines of code wherever indicated. 5 question 20 points a piece #you may use your book and internet but no form of messaging or communication #QUESTION 1 #Read in the file exam_file.txt #Print to the console every other line #QUESTION 2 #Read in exam_file.txt #split file into words #write to a file called question2.out that contains 1 word per line (words can occur more than once) #QUESTION 3 # Print out all the Middle Initials in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT