Question 2: Sum of consecutive odd View Past Answers No past answers. Write a program which asks user to enter an integer n, calculates the total sum of the consecutive ODD integers from 1 to n (inclusive of n if n is odd) and store in the variable called sum calculates the average value of the consecutive ODD integers from 1 to n and store in the variable called average prints the value of sum and average For example if n = 7, the program will compute 1+3+5+7, sum = 16, average = 4 if n = 6, the program will compute 1+3+5, sum = 9, average = 3

Pls help ya thx(btw this is python)

Answers

Answer 1

Answer:

number = int(input("Enter number ") )

sum = 0

count = 0

for x in range(1, number+1, 2):

 sum += x

 count += 1

average = sum/count

print("sum = %d"% sum)

print("average = %d"% average)

The range() function conveniently lets you enumerate all odd values from 1 to your number.


Related Questions

why would it be essential for the successful A/V technician to participate in additional coursework, presentations, and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry​

Answers

Answer:

its not loading for me :/

Explanation:

Answer:

they can get a better background of what they're learning about

Explanation:

Which of the following statements can be used as evidence that ancient Greek beliefs and art has been influential? Select the three correct answers. A. The Metropolitan Museum of Art in Modern in New York City contains many abstract paintings. B. We read fables as children to learn moral lessons. C. Today sculptors and painters avoid realism in their art. D. The columns of the Lincoln Memorial in Washington D.C. provide balance and harmony. E. Comedies and dramas are popular types of theater on Broadway.

Fist one will mark brainlyest

Answers

Answer:

A, B, D

Explanation:

I'm gonna go with these few answers because, well I'm not an expert with this stuff but the Metroplian Museum of Art has the Greek Design on the walls. And B, children are required in school to read such things for this reason. And D, seams like the correct answer for this better than the other ones.

Hope I helped you out, Reza106157

Answer:

B

Explanation:

Laura would like to include additional text that is related to the document but not contained within the document.
Which option should she use to achieve this goal?
O text box
O sidebar
O pull quote
O bibliography

Answers

The answer is sidebar

Answer:

side bar

Explanation:

edge 2022

where do you expect to participate in distance learning from?

Answers

Answer:

hahaha very funny

Explanation:

pls rate this answer a 5/5 and heart it

Answer: Huh... Obviously Brainly

Explanation:

Give me the Brainliest!!

What is a tag in an HTML document?

Answers

Answer: HTML is considered as the Lingua franca of the net that is a simple mark up language used for the purpose of web publishing for creating text and images. This can be viewed by any of the member and can be used within any browser. There is no need of special software for creating HTML pages and moreover the learning of HTML is pretty easy.

Explanation: If you need more help go follow me at dr.darrien

- thank you

They are absolutely right.

Jose needs to find out how to delete cells from his workbook.
Which method is the quickest way for Jose to get step-by-step directions?
O Do research on the internet.
O Press F1 and type "delete cells” in the search bar.
O Click the ? on the top-right corner in the Backstage View.
O Type "delete cells” in the “Tell me what you want to do” bar.

Answers

Answer:

Its D dont listen to det b up der

Explanation:

Answer:

D- type "delete cells" in the “Tell me what you want to do” bar.

Explanation:

have a good day

Which tools can be found in the Page Layout tab of the ribbon? Check all that apply.
Print Area settings
font size and color
printer selection
margin settings
orientation
Print Titles

Answers

Margin Settings and Orientation

Answer:

A. D. E. F.

Explanation:

edg 2020

All of the data in a digital book (letters, punctuation, spaces, etc) are stored and processed in a computer as binary. Break down how this works (hint: Ascii) . Explain in three or more sentences: Please Answer ASAP, Brainiest for Best and most In detail answer!!!!!

Answers

Can I have the Brainiest pls pls pls

All of the following are helpful tips for protecting your digital privacy, except:

A. Review the privacy policy and terms of service

B. Turn cookies on in your browser settings

C. Review the app’s privacy settings and opt out of any sharing options you’re not comfortable with.

D. Use ASK ( what’s accessed, shared, and known) to analyze how using the app will affect your privacy.

Answers

Answer:

B

Explanation:

Cookies are used to track visitors of websites

B. Turn cookies on in your browser settings
Other Questions
In the United States, the distribution of power between the levels of government is a product of the Constitution.TrueFalse A shade of green paint called Groovy Green is made by combining yellow paint and blue paint so that the ratio, by volume, of yellow paint to blue paint is 12 to 5. How many tablespoons of blue paint are needed to make 34 cups of Groovy Green? ( 1 cup= 16 tablespoons) Please answer this question now Isaiah has been taught not to get involved in drugs. However, he puts that aside and tries marijuana after he sees his older brother using it without getting in trouble. What best explains Isaiah's behavior? The Mauryan Empire A. defeated the troops of Alexander the Great at the battle of Kalinga. B. contained many Greek-speaking regions. C. remained at constant war with the Seleucid Empire based in Syria. D. sought to suppress Buddhism as a threat to royal authority. E. worked to establish its legitimacy by imposing a strict Vedic artistic style on all public buildings and monumental structures. What is the pathway of sound through fluids starting at the oval window through to dissipation of the sound waves at the round window How to do 28a ? Thanks what modification do we find in the steam and petiole of the aquatic plants Explain the advantages and disadvantages of using surveys for data collection. please help will give brainliest 7. The General Society Survey asked a sample of 1200 people how much time they spent watching TV each day. The mean number of hours was 3.0 with a standard deviation of 2.87. A sociologist claims that people watch a mean of 4 hours of TV per day. Do the data provide sufficient evidence to disprove the claim? Use = .05 to test the hypothesis. a. What are your null and alternative hypotheses? b. What test is appropriate here? Why? c. What is your test statistic? d. What is your critical value? e. What is your final decision: do you reject the null or fail to reject the null? what are the elements of art in figure raspberries and goldfish by Janet fish Read this passage from Through the Looking-Glass.Then hand round the plum-cake, Monster, the Lion said, lying down and putting his chin on this paws. And sit down, both of you, (to the King and the Unicorn): fair play with the cake, you know!The King was evidently very uncomfortable at having to sit down between the two great creatures: but there was no other place for him.What a fight we might have for the crown, now! the Unicorn said, looking slyly up at the crown, which the poor King was nearly shaking off his head, he trembled so much.What is the relationship between the King, the Lion, and the Unicorn in this passage?The Lion envies the King and wants his ruling power.The Unicorn is uncomfortable with the Lion and the King.The King is nervous around the strong, ferocious animals.The animals are shy because the King wears the crown. what are the functions of protein Angie has 18 oatmeal cookies.She splits them evenly among b bags.Choose the expression that shows how many cookies are in each bag. 1.B-18 2.18/b 3.18 4.B Solve this inequality: x+ 4< 16 Mike wants to buy a used car for $3200. He has$400 in savings and can save another $250 each month. How many months will it take him to be able to buy this car? Dont ........................... what I am telling you. I dont mean so. (INTERPRET) In December of each year, Eleanor Young contributes 10% of her gross income to the United Way (a 50% organization). Eleanor, who is in the 24% marginal tax bracket, is considering the following alternatives for satisfying the contribution. Fair Market Value(1) Cash donation $152,200 (2) Unimproved land held for six years ($22,830 basis) $152,200 (3) Blue Corporation stock held for eight months ($22,830 basis) $152,200 (4) Gold Corporation stock held for two years ($182,640 basis) $152,200 Eleanor has asked you to help her decide which of the potential contributions listed above will be most advantageous tax-wise. Evaluate the four alternatives and complete a letter to Eleanor. Required:Determine the amount of the charitable contribution for each option. What is the verb?A. AnswerB. TellC. Did tell Aakash has a liability of 6000 due in four years. This liability will be met with payments of A in two years and B in six years. Aakash is employing a full immunization strategy using an annual effective interest rate of 5%. Calculate AB.