Question

# 3. PUT IN PYTHON CODE # Write a program that prints a count of how...

# 3. PUT IN PYTHON CODE

# Write a program that prints a count of how many occurrences of the letter "a"
# there are in q. Do to this you will have to use a loop within a loop.

q = ["apple", "beans", "orange", "tangerine", "butter", "watermelon", "vinegar"]

# Type your answer here:

0 0
Add a comment Improve this question Transcribed image text
Answer #1
q = ["apple", "beans", "orange", "tangerine", "butter", "watermelon", "vinegar"]
count = 0
for x in q:
    for y in x:
        if(y=='a'):
            count += 1
print(count)

6

Add a comment
Know the answer?
Add Answer to:
# 3. PUT IN PYTHON CODE # Write a program that prints a count of how...
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
  • In python Please type the code Question 4: Write a program that reads an English word...

    In python Please type the code Question 4: Write a program that reads an English word from the user, and prints how many vowels and how many consonants it contains. Note: You may assume the letter Y is not a vowel. Sample output (2 different executions) Enter a word: test test has 1 vowels and 3 consonants Enter a word: Apple Apple has 2 vowels and 3 consonants.

  • 1. Write a python program that reads a file and prints the letters in increasing order...

    1. Write a python program that reads a file and prints the letters in increasing order of frequency. Your program should convert entire input to lower case and only counts letters a-z. Special characters or spaces should not be counted. Each letter and it's occurrences should be listed on a separate line. 2. Test and verify your program and it's output. ---Please provide a code and a screenshot of the code and output. Thank you. ----

  • (Count the occurrences of each keyword) Write a python program that reads in a Python source...

    (Count the occurrences of each keyword) Write a python program that reads in a Python source code file and counts the occurrence of each keyword in the file. Your program should prompt the user to enter the Python source code filename.

  • THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM...

    THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM FOR PYTHON This time, we will write a program that uses functions to parse through all those names in a List object (see below for the "us_counties" list) to count the number of occurrences each vowel (a, e, i, o, u) has in all the names. We want 5 separate answers, one for each vowel. Not looking for output here. All my solution will...

  • In Python 3, Write a program that reads in a text file that consists of some...

    In Python 3, Write a program that reads in a text file that consists of some standard English text. Your program should count the number of occurrences of each letter of the alphabet, and display each letter with its count, in the order of increasing count. What are the six most frequently used letters?

  • 1) Translate the following equation into a Python assignment statement 2) Write Python code that prints...

    1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...

  • Write a program in python that asks the user to input a sentence. The program will...

    Write a program in python that asks the user to input a sentence. The program will ask the user what two letters are to be counted. You must use a “for” loop to go through the sentence & count how many times the chosen letter appears in the sentence. You are not allowed to use python built-in function "count()" or you'll get a Zero! Output will show the sentence, the letter, and the number of times the letter appears in...

  • Write a Python program that prints a name as shown in the image below. The program...

    Write a Python program that prints a name as shown in the image below. The program asks the user to enter a name and how many time the user wants to display the name.. You need two to input two integer values. First, for repeating name in a row. Second, for number of rows. In total, your program will have three inputs. Add three comment lines at start of the program, which shows program purpose, your name and date. Hint:...

  • 1. Questions Python Code: For each line of code, write the type of error (syntax, semantics,...

    1. Questions Python Code: For each line of code, write the type of error (syntax, semantics, runt-time), cause of the error, and your fix. (1) def fun(num letter) (2) num == 7 + num (3) return 'num' - letter (4) result = fun(5, x) 2. Question Python Code: Run the code below to check the outputs of the print() call on lines 12. And : A) Analyze the application of the accumulation pattern and answer the following questions: #1. a....

  • Write python code on computer, No handwritten code You will implement a program which asks the...

    Write python code on computer, No handwritten code You will implement a program which asks the user to enter scores of different courses in different semesters. The program should read the input and output some simple statistics 1. An example input string by the user is given below. Fal12016-coursel:82, course2:80,course3:85;Spring2018- course4:82;Fall2018-course5:85, course6:50, course7:78 Info from different semesters are separated by a ";", courses in each semester are separated by a,and score and corresponding course is separated by a, information of...

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