In this exercise we will practice using loops to handle collections/containers. Your job is to write a program that asks the user to enter a sentence, then it counts and displays the occurrence of each letter.
Note: your program should count the letters without regard to case. For example, A and a are counted as the same.
Here is a sample run:
Enter a sentence: It's a very nice day today!
a: 3 times
c: 1 times
d: 2 times
e: 2 times
i: 2 times
n: 1 times
o: 1 times
r: 1 times
s: 1 times
t: 2 times
v: 1 times
y: 3 times
Notes:
The purpose of this problem is to practice using loops and collections/containers/strings.
Please make sure to submit a well-written program. Good identifier names, useful comments, and spacing will be some of the criteria that will be used when grading this assignment.
This assignment can be and must be solved using only the materials that have been discussed in class: loops, the index system, strings, lists and/or dictionaries. Do not look for or use alternative methods that have not been covered as part of this course.
How your program will be graded:
correctness: the program performs calculations correctly: 40%
complies with requirements (it properly uses loops, and containers/strings): 40%
code style: good variable names, comments, proper indentation and spacing : 20%
Language is python 3

Answers

Answer 1

Answer:

In Python:

chars = 'abcdefghijklmnopqrstuvwxyz'

letter = input("Sentence: ")

for i in range(len(chars)):

   count = 0

   for j in range(len(letter)):

       if chars[i] == letter[j].lower():

           count = count + 1

   if count > 0 :

       print(chars[i]+": "+str(count)+" times")

Explanation:

This initializes the characters of alphabet from a-z

chars = 'abcdefghijklmnopqrstuvwxyz'

This prompts the user for sentence

letter = input("Sentence: ")

This iterates through the initialized characters

for i in range(len(chars)):

This initializes count to 0

   count = 0

This iterates through the input sentence

   for j in range(len(letter)):

This compares the characters of the sentence with alphabet a-z

       if chars[i] == letter[j].lower():

If there is a match, count is incremented by 1

           count = count + 1

If there is an occurrence of character,

   if count > 0 :

The character and its count is printed

       print(chars[i]+": "+str(count)+" times")

Answer 2

In this exercise we have to use the knowledge of computational language in Python, so we have that code is:

It can be found in the attached image.

So, to make it easier, the code in Python can be found below:

chars = 'abcdefghijklmnopqrstuvwxyz'

letter = input("Sentence: ")

for i in range(len(chars)):

  count = 0

  for j in range(len(letter)):

      if chars[i] == letter[j].lower():

          count = count + 1

  if count > 0 :

      print(chars[i]+": "+str(count)+" times")

See more about python at brainly.com/question/26104476

In This Exercise We Will Practice Using Loops To Handle Collections/containers. Your Job Is To Write

Related Questions

You have searched a database to locate US cities with population counts above 1 million people. You need to present the results to the class. Which of these describes the process you should use to accomplish these tasks?

options

enter data into a form and present it to the class

present the table you used to search for cities with more than 1 million people

run a query and create a report from the datasheet

run a query and present the datasheet to the class

Answers

Answer:

Run a query and create a report from the datasheet.

Explanation: creating a report will give a easy to understand explanation of all the data you have collected.

Answer:

the answer is C

the next one is B

Explanation:

Josh wrote the following e-mail to his co-worker. PLEASE HELP QUWICK



i need the figues to enter them into my DBA presentation. ASAP. please send.

This is an example of _____.


effective communication

nonverbal communication

ineffective communication

workplace communication

Answers

Answer:

Answer choice 4

Explanation:

If Josh sends an e-mail to his... co-worker.... wouldn't that be... workplace communication?

D because he is sending a email to his coworker making it workplace communication

What do you call the parts of the motor that do not move?.

Answers

Answer:

The stator..?

Explanation:

Stators are the stationary parts of motors. Dunno if I'm right lol

PROJECT: RESEARCHING THE HISTORY OF THE INTERNET
The Internet has had a profound effect on how we conduct business and our personal lives. Understanding a bit about its history is an important step to understanding how it changed the lives of people everywhere.

Using the Internet, books, and interviews with subject matter experts (with permission from your teacher), research one of the technological changes that enabled the Internet to exist as it does today. This may be something like TCP/IP, the World Wide Web, or how e-mail works. Look at what led to the change (research, social or business issues, etc.) and how that technology has advanced since it was invented.
Write a research paper of at least 2, 000 words discussing this technology. Make sure to address the technology’s development, history, and how it impacts the Internet and users today. Write in narrative prose, and include a small number of bullet points if it will help illustrate a concept. It is not necessary to use footnotes or endnotes, but make sure to cite all your sources at the end of the paper. Use at least five different sources.

Submission Requirements
Use standard English and write full phrases or sentences. Do not use texting abbreviations or other shortcuts.
Make any tables, charts, or screen shots neat and well organized.
Make the information easy to understand.

Answers

E-mail, short for “electronic mail” is one of most widely used forms of digital communication. It can be used from nearly any device, and unlike paper mail, it is delivered nearly instantly. E-mail is used in all strata of society, and has endless possibilities for personal and professional uses.

It can be used to send messages, links, images and files, essentially everyone on the planet who uses computers will use e-mail. It powers business and connects families together across continents, and the best part of all is that it is essentially free. People use e-mail on personal computers, mobile phones, tablets, even on ‘smart’ televisions!

Every e-mail address has an inbox. This is where new messages are deposited. An e-mail message has a status called “unread” which disappears after the e-mail has been opened. A typical e-mail inbox will also have a ‘Sent’ folder for viewing messages that you have sent in the past. It also will have an ‘Outgoing’ folder, where messages stay until they have been fully transmitted. It is also common to have a ‘Drafts’ folder for messages that were started but never sent, and a ‘Spam’ folder, where unwanted marketing messages will usually be directed. You can of course setup your own folders and sort your e-mails however you like .

How do I fix a phone if I don't have enough money for me to fix it?

Answers

Answer:

depends whats wrong with it

Explanation:

is the screen smashed orr~

Which operation will remove the originally selected information?
O Duplicate
O Copy
O Paste
O Cut

Answers

Answer:

D. the cut command

Explanation:

What is the value of grade after this program is executed? Assume the score is 50. if score >= 90: grade = "A" elif score >= 80: grade = "B" elif score >= 70: grade = "C" elif score >= 60: grade = "D" else: grade = "F" grade =

Answers

Answer is b took the test

Answer:

the grade would be C

Explanation:

Which of the following statements demonstrates the consequence of segregated medical
care?
A. Inequitable access to education and funding for Black doctors
B. Fewer predominately white medical schools being open to Black students
C. Both A and B
D. Neither A nor B

Answers

Answer:

C. Both A and B

Explanation:

Not only is inequitable access to education and funding for Black doctors a consequence of segregated medical care, it also resulted in less predominately white medical schools allowing Black students.

The statements that demonstrate the consequence of segregated medical care are both statements A and B. The correct option is C.

What is segregated medical care?

To distinguish or put apart from others or the general population. Segregated medical care has led to Black students being accepted into less primarily white medical institutions, which has resulted in unequal access to education and funding for Black professionals.

Black doctors have unequal access to education and funding. Less predominantly white medical colleges accept students of color.

Medical discrimination, racialized socioeconomic deprivation, and a segregated healthcare system all contribute to drastically different experiences in care for Black and White patients.

Therefore, the correct option is C. Both A and B.

To learn more about segregated medical care, refer to the link:

https://brainly.com/question/10812745

#SPJ6

In Python!!
1. Correcting string errors
It's easy to make errors when you're trying to type strings quickly.
Don't forget to use quotes! Without quotes, you'll get a name error.
owner = DataCamp
Use the same type of quotation mark. If you start with a single quote, and end with a double quote, you'll get a syntax error.
fur_color = "blonde'
Someone at the police station made an error when filling out the final lines of Bayes' Missing Puppy Report. In this exercise, you will correct the errors.
# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors
birthday = "2017-07-14'
case_id = 'DATACAMP!123-456?
2. Load a DataFrame
A ransom note was left at the scene of Bayes' kidnapping. Eventually, we'll want to analyze the frequency with which each letter occurs in the note, to help us identify the kidnapper. For now, we just need to load the data from ransom.csv into Python.
We'll load the data into a DataFrame, a special data type from the pandas module. It represents spreadsheet-like data (something with rows and columns).
We can create a DataFrame from a CSV (comma-separated value) file by using the function pd.read_csv.
# Import pandas
import pandas as pd
# Load the 'ransom.csv' into a DataFrame
r = ___.___('___')
# Display DataFrae
print(r)
3. Correcting a function error
The code in the script editor should plot information from the DataFrame that we loaded in the previous exercise.
However, there is an error in function syntax. Remember that common function errors include:
Forgetting closing parenthesis
Forgetting commas between each argument
Note that all arguments to the functions are correct. The problem is in the function syntax.
# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors
# Plot a graph
plt.plot(x_values y_values)
# Display the graph
plt.show()
4. Snooping for suspects
We need to narrow down the list of suspects for the kidnapping of Bayes. Once we have a list of suspects, we'll ask them for writing samples and compare them to the ransom note.
A witness to the crime noticed a green truck leaving the scene of the crime whose license plate began with 'FRQ'. We'll use this information to search for some suspects.
As a detective, you have access to a special function called lookup_plate.
lookup_plate accepts one positional argument: A string representing a license plate.
# Define plate to represent a plate beginning with FRQ
# Use * to represent the missing four letters
____ = ____
Please help out~~~

Answers

Answer:

Following are the solution to the given points:

Explanation:

For point 1:

birthday = "2017-07-14" # defining a string variable birthday that string value  

case_id = 'DATACAMP!123-456?' #defining a variable case_id that stores the string value

In this, two variable "birthday and case_id" is defined, that holds the string value. In the first variable, it uses the hyphen sign to hold the date value as a string. In the second variable, it uses a single quoit to store string value.  

For point 2:

import pandas as pd # using import package to import pandas  

r = pd.read_csv('ransom.csv')# defining r variable that uses pandas to Load the 'ransom.csv' file

print(r)#use print method to print r value

In this code, a pandas package is imported, and in the next step r variable is defined that uses the read method to hold the csv file , and the print method to print r value.

For point 3:

plt.plot(x_values, y_values) # Plot method to hold parameters values

plt.show()#calling the show method

In this code, the plot method is used, which accepts two-parameter to store its value into plt, and in the next step, it uses the show method.  

For point 4:

# Defining a plate variable to represents the plate that starts with FRQ

# Using the * to represent the four missing letter

plate = lookup_plate('FRQ*)  

What will be the output?
class num:
def __init__(self, a);
self.number = a
def_mul__(self,b):
* return self.number + b.number
#main program
numA = num(8)
numB = num(4)
result = numA* numb
print(result)
O4
O 12
O 32
4096

Answers

Answer : 32

Explanation

the variable a & b and A & B are different. So the only program that work is at #main program.

Hence that A = 8 and B = 4 and the result is A * B so 8*4=32.

Sorry if im wrong

32  will be the output of this question

What is the output?

An industry's output is the total amount of goods and services generated within that industry over a specific time period and sold to customers or other firms. An industry's annual production of boxes of cookies or tons of sugar, for instance, can be considered output.

The quantity a person produces in a particular period of time. d.: energy or power given or produced by a device or system (as for storage or for conversion in kind or in characteristics)Here is how we might define these two phrases in business terms: The results are what the business requires or wants to accomplish. The acts or things that help achieve an outcome are called the outputs.

Variables a and b and A and B are distinct. Thus, the #main program is the only program that functions. Because A = 8 and B = 4, the outcome is A * B, which equals 8*4=32.

Therefore,  the output of this question

Learn more about output here:

https://brainly.com/question/13736104

#SPJ5

An articulated robot has a T-type wrist axis that can be rotated a total of 2 rotations (each rotation is a full 3600 ). It is desired to be able to position the wrist with a control resolution of 0.250 between adjacent addressable points. (a) Determine the number of bits required in the binary register for that axis in the robot's control memory. (b) Using this number of bits, what is the actual control resolution of the joint

Answers

T pose my guy cuz my friend here Justin is next to me

In order to ask for user for input in store the results as a stream, you should use the function. Readline, readlnt, string, algorithm

Answers

Answer: String

-DoggyMan5

Write a program that calculates the area & perimeter of a rectangle, where
the values for width and length are given by the users.

Answers

Answer:

In Python:

Length = float(input("Length: "))

Width = float(input("Width: "))

Area = Length * Width

Perimeter = 2*(Length + Width)

print(Area)

print(Perimeter)

Explanation:

This gets the length from the user

Length = float(input("Length: "))

This gets the width from the user

Width = float(input("Width: "))

This calculates the area

Area = Length * Width

This calculates the perimeter

Perimeter = 2*(Length + Width)

This prints the area

print(Area)

This prints the perimeter

print(Perimeter)

what is 30 x 30 x 30 x 30

Answers

810,000 i asked siri

Answer:

its is 810000

Explanation:

hope this helps

the internet is a network of only ten thousands computers true or false

With saying why true or why false

Thanks ​

Answers

Answer: False

Reason: There's a lot more then 10 thousand computers on the internet.

EASY In the image, what will be the result of pressing the Delete key
TWO times?
O Determation
O Determination
O Determinion
O Determition

Answers

D would be the answer
Determation I’m guessing

ANSWER QUICK 50 POINTS
You have the following code in your program.

from array import *
Which line of code would create an array?


D = array([2.5, 3, 7.4])

D = array('f',[2.5, 3, 7.4])

D = array['f',[2.5, 3, 7.4]]

D = array('f',2.5, 3, 7.4)

Answers

Answer:

D = array('f',[2.5, 3, 7.4])

Explanation:

is the answer

A variable must be declared with an array type before the array itself can be created. Array types resemble other Java types, with the exception that square brackets are placed after them ( [] ). Thus, option D is correct.

What line of code would create an array?

Using the NumPy library, new data types known as arrays can be produced in Python. NumPy arrays are created for numerical studies and only contain one data type.To build an array, use the array() method after importing NumPy. The input for the array() function is a list.

An array, also known as a database system, is a group of things or data that is held in a contiguous memory area in coding and programming. Several instances of the same kind of data are grouped together in an array.

Therefore, D = array('f',2.5, 3, 7.4)  line of code would create an array.

Learn more about array here:

https://brainly.com/question/22296007

#SPJ2

Identify advantages that web designers gained by
switching to divs and CSS for page layout. Check
all of the boxes that apply.
Divs describe the type of content they
contain.
Divs can be styled to any shape, size, or
location on a page.
Divs can contain a combination of tagged
content.

Answers

Answer:

B Divs can be styled to any shape, size, or location on a page.

C Divs can contain a combination of tagged content.

Explanation:

Given three subroutines of 550, 290, and 600 words each, if segmentation is used then the total memory needed is the sum of the three sizes (if all three routines are loaded). However, if paging is used, then some storage space is lost because subroutines rarely fill the last page completely, and that results in internal fragmentation. Determine the total amount of wasted memory due to internal fragmentation when the three subroutines are loaded into memory using each of the following page sizes:
a. 100 words
b. 600 words
c. 700 words
d. 900 words

Answers

The answer is D i got it right when I did it

Typically, external fragmentation wastes one-third of memory. Internal fragmentation occurs when space inside a designated region is wasted. Thus, option D is correct.

What wasted memory due to internal fragmentation?

The mounted-sized block is allotted to a method whenever a request for memory is made. Internal fragmentation is the term used to describe the situation where the memory allotted to the method is a little bigger than the amount requested.

Normally, memory is allocated in uniformly sized blocks, but sometimes a process doesn't use the entire block, leading to internal fragmentation.

Memory fragmentation occurs when a memory allocation request can be satisfied by the whole amount of accessible space in a memory heap, but no single fragment (or group of contiguous fragments) can.

Therefore,  when the three subroutines are loaded into memory using each of the following page sizes 900 words.

Learn more about memory here:

https://brainly.com/question/16953854

#SPJ5

Your computer system looses power while you are working on a project for a very important client

Answers

isljgaek jadkghdkjhasdkjfhadskj afhdsfkjdahk dh

Answer:

I never knew that, thank you for telling me! I'll note that down

Pls help I will give points

Answers

Answer:

Desktop

Explanation:

Count operation Lucky twos
Lucky Twos determines and displays the number of digits that are 2s in a whole number. For example, the number of 2s in 3487 is 0, while the number of 2s in 272521 is 3. Note: whole numbers are non-negative integers starting at zero 0, 1, 2, 3, 4.
Assume that the fractional part is discarded in the division:
10 / 4 = 2
8 / 5 = 1
20 / 3 = 6
Read number
set count to 0
while number > 0
If the number module 10 is Then add
1 to count
End If
Compute number as number / 10
End while
Display count.
Let n be the number of digits of the whole number. What is the number of operations that are executed in the code in terms of n?

Answers

Answer:

Following are the solution to this question:

Explanation:

Its complexity of both the pseudo-code described is indeed proportional to the number of digits. So, how often number there are in this specific number is the query. Whenever a number is considered, the d digit would be between [tex]10^{(d-1)}.[/tex] inclusive exclusive [tex]10^d[/tex] That would be as, let d become the number of digits at N, and the inequalities, They can tell

[tex]10^{(d-1)} \leq N < 10^d[/tex]

We get, we take a logarithm,

[tex]d-1 \leq \log(N) < d[/tex]

The increase of 1 to the left inequality, [tex]d \leq \log(N)+1[/tex], and Combining the previous outcome, we got, [tex]\log(N) < d \leq \log(N) + 1[/tex]. That's would be to say, that number of number d by [tex]O(\log(N))[/tex] is higher and lower. Consequently, the number of transactions in the code is [tex]O(\log(N))[/tex]

We have that the number of operations that are executed in the code in terms of n  is mathematically given as

The quantity of operations done in the code is O(log(N))

Operation

Generally the equation for the   is mathematically given as

If we think about a number,

with d digits is between 10^(d-1) inclusive and 10^d exclusive.

Let d be the wide variety of digits in N

10^(d-1) <= N < 10^d

d-1 <= log(N) < d

d <= log(N) + 1,

The Inequality

log(N) < d <= log(N) + 1.

Therefore

The quantity of operations done in the code is O(log(N))

For more information on Inequality visit

https://brainly.com/question/19491153

what will allow you to immediately exit the program without rebooting the computer, when you realize your browser is not responding ​

Answers

Answer:

the exit button on top right or x out of that certain tab

Explanation:

Which of the following make up atoms? A. weight, mass, and gravity B. protons, electrons, and neutrons C. elements, compounds, and molecules D. matter, non-matter, and air pressure

Answers

Answer:

B

Explanation:

protons, electrons and neutrons

A switch on a circuit board can be in two states what are they​

Answers

Answer:

on and off

Explanation:

use a for loop to create a random forest model for each value of n estimators from 1 to 30;
• evaluate each model on both the training and validation sets using MAE;
• visualize the results by creating a plot of n estimators vs MAE for both the training and validation sets
After that you should answer the following questions:
• Which value of n estimators gives the best results?
• Explain how you decided that this value for n estimators gave the best results:
Why is the plot you created above not smooth?
• Was the result here better than the result of Part 1? Wha: % better or worse was it? in python

Answers

Answer:

nvndknnnnnnngjf

Explanation:

f4tyt5erfhhfr

it just said i was blocked from brainly for a sec i was like- dang- then i logged in again then it was back to normal uHhHh can someone eXpLaIn ?

Answers

Answer:

it has been doing the same to me if your on a school computer at home then it will bug sometimes but if you were at school then it would probably be entirely blocked but idrk

Explanation:

Answer:

It was probably a glitch in the site.

Explanation:

Sometimes sites glitch out and they say certain things but when you log back in or refresh the page your fine. I don't think it's anything to worry about.

Which of the following items are present in the function header?

A. function name and parameter (variable) list

B. parameter (variable) list

C. return value

D. function name

Answers

Where is the function header you speak of ?
Variable list. Variables always come first

Prompt
Using complete sentences post a detailed response to the following.

While visiting a friend’s house, you hear their siblings arguing over whether or not “visual novels” are “real games” or not. You hear Boris, the older sibling, saying “…and you just sit there and click to read the next line—you might as well be reading a comic book and turning a page and call that a ‘game’!” When they find out you’ve been taking a class on game design, they ask you to settle the argument for them. What would you say to them?

Answers

Prompt is a game code technically a tiko machine that turns into machines that fraud into the new line that put in a friends house.

Answer:

As long as it works like a game and not a book i would say its a game.

Explanation:

Pls help mark brainliest

Answers

Answer:

I cant answer this.

Explanation:

You need to take another screenshot so we can see the multiple choice.

Other Questions
Grace took one of her friends out to lunch. The lunches cost $100 and she paid 9% sales tax. If Grace left a 15% tip on the $100, how much in total did she pay? k^2 ; k = 4 pls help Technology of WWI: The Machine Gun Geometry need help........ 1. Describe the plate location of the African plate?2. Describe the plate location of the South American plate?3. Describe the plate location of the Pacific plate?(please be asap if you can !!) What is something you learned about movement across the membrane what is 303 x 303 x 23 x 456 - 797 complete the equation of the line through ( 3,1) and ( 4,7) . can someone else help me pleased . please help it should be ez for you guys ;-; brainiest to best answer :D Select all that apply.Learning styles include all of the following:bodily/kinestheticverbal/linguisticnaturalisticpersonal Florence makes y cards in 3 minutes. how many cards does she make in 1 minute Please help I don't understand how to do this lol What is the car's acceleration from 0 to 1 second?A. 8 mph/sB. 20 mph/sC. 60 mph/sD. 10 mph/s Classify each of the substances as an atomic element, molecular element, molecular compound, or ionic compound. Provide one sentence explanation for each. a. fluorine b. N2 O c. silver d. K2 O e. Fe2 O3 g I NEED THIS FOR A QUIZ PLS How did Will Rogers become famous Describe what the caste system is using the words karma, dharma, reincarnated, and caste. Light travel in __________ lines until reflected or refracted . help now NOW NOW NNNOOOWWW, please Use the diagram below for 4-6