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
sweet [91]
3 years ago
6

Write a Python program that will take as input 5 integer values and will output the average of the odd values and the average of

the even values that were input. You will need to use if and elif statements to classify each value as odd or even. Be sure to keep track of how many odd values and even values you have, so you can calculate the correct average for each set of values.

Computers and Technology
1 answer:
8_murik_8 [283]3 years ago
6 0

Code:

Here is the code. Also screenshot of the code and text file containing the code have been attached here.

This code has been written in Python 3.0

# getting input

lst = [ ]  

n = 5  

for i in range(0, n):  

   ele = int(input())  

   lst.append(ele)

print(lst)

# getting odd numbers and even numbers from list and compute average

odd_sum = 0

even_sum = 0

odd = 0

even = 0

for i in range(0, n):  

   if lst[i] % 2 == 0:

       even_sum = even_sum + lst[i]

       even = even + 1

   elif lst[i] % 2 > 0:

       odd_sum = odd_sum + lst[i]

       odd = odd + 1

       

odd_avg = odd_sum/odd

even_avg = even_sum/even

print("there were",odd,"odd numbers in input")

print("there were",even,"odd numbers in input")

print("average of odd numbers in the list",odd_avg)

print("average of even numbers in the list",even_avg)

You might be interested in
When selecting font size in a document, ____ points equals one-inch-tall text?
IgorC [24]
Hello <span>Jhigg4685 
</span><span>

Answer: When selecting font size in a document, 72 points equals one-inch-tall text?


I hope this helps
-Chris</span>
3 0
3 years ago
clinical outcomes and survival differences between primary, secondary and concomitants carcinoma in situ of urinary bladder trea
8_murik_8 [283]

The summary of the research - clinical outcomes and survival differences between primary, secondary and concomitants carcinoma in situ of urinary bladder treated with BCG Immunotherapy is given below.

<h3>What is the summary of the above research?</h3>

Urinary bladder carcinoma in situ (CIS) is a flat, high-grade, and aggressive form of urothelial cancer with a high likelihood of development to muscle-invasive illness and metastatic dissemination.

The study's goal was to compare the clinical histories and survival rates of primary, secondary, and concurrent CIS of the bladder.

Learn more about Immunotherapy at brainly.com/question/14493516

#SPJ1

6 0
1 year ago
Read 2 more answers
An operating system is defined as hardware that converts software into a useful form for applications.
marissa [1.9K]

Hardware that transforms software into a form that is helpful for applications is referred to as an operating system. False. Hardware conversion is done by software.

<h3>What is an operating system?</h3>
  • Computer hardware and software resources are managed by an operating system (OS), which also offers common functions for software programs.
  • Operating systems that use time-sharing plan activities to make the most of the system's resources.
  • They may also contain accounting software to allocate costs for processing time, mass storage, printing, and other resources.
  • An operating system (OS) is a piece of software that controls all of the other application programs in a computer after being originally loaded by a boot program.
  • Through a specified application program interface, the application programs seek services from the operating system (API).

To learn more about operating system, refer to:

brainly.com/question/22811693

#SPJ4

4 0
1 year ago
Jennifer’s company currently uses Windows Active Directory to provide centralized authentication, authorization, and accounting
Vsevolod [243]

Answer:

RADIUS

Explanation:

Remote Authentication Dial-In User Service (RADIUS) is a networking protocol that provides centralized Authentication, Authorization, and Accounting management for users connected to a network service. It can be used to authenticate anyone who is on your network.

RADIUS is a protocol that uses TCP or UDP as transport. RADIUS client is what is used to communicate with RADIUS servers at gateways of the network.

8 0
3 years ago
100 POINTS NEED ASAP PLEASE HELP
givi [52]

It is actually podcast! i took the quiz as well :)

3 0
3 years ago
Read 2 more answers
Other questions:
  • True or false the primary advantage of the worksheet is the ability to solve numerical problems quickly and accurately
    11·1 answer
  • With a patent on drug Z27, why would Able Drug Company charge customers $7 per 100 units even though its cost of producing 100 u
    5·2 answers
  • A restaurant bill comes to $28.35. Find the total cost if the tax is 6.25% and a 20% tip is left on the amount before tax.​
    6·1 answer
  • You have no control over who views your social network information
    13·2 answers
  • Write multiple if statements. if caryear is 1969 or earlier, print "probably has few safety features." if 1970 or higher, print
    6·1 answer
  • What do the letters of the su command stand for? what can you do with su besides give yourself root privileges? "what can you do
    5·1 answer
  • Write a program that utilizes the concept of conditional execution, takes a string as input, and: prints the sentence "Yes - Spa
    8·1 answer
  • Question<br> 1. Who was the first to use an abacus
    6·1 answer
  • Frrrrrrrrrrreeeeeeeeee brainliest for u
    13·2 answers
  • True or False? The background color block should be inserted after all the images are added.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!