Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PARTICIPATION ACTIVITY 5 . 5 . 3 : For loops. Fill in the missing code to perform the desired calculation. 1 ) Compute the average

PARTICIPATION ACTIVITY
5.5.3: For loops.
Fill in the missing code to perform the desired calculation.
1)
Compute the average number of kids.
# Each list item is the number of kids in a family.
num_kids =[1,1,2,2,1,4,3,1]
total =0
for num in num_kids:
total +=
average = total / len(num_kids)
Check
Show answer
2)
Assign num_neg with the number of below-freezing Celsius temperatures in the list.
temperatures =[30,20,2,-5,-15,-8,-1,0,5,35]
num_neg =0
for temp in temperatures:
if temp <0:
Check
Show answer
3)
Print scores in order from highest to lowest. Note: List is pre-sorted from lowest to highest.
scores =[75,77,80,85,90,95,99]
for scr in
:
print(scr, end='')
Check
Show answer

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions