Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 7: Use for loop Write a python program that computes sum of odd numbers in the list given below list1- [4, 3, 6, 5,

image text in transcribed

Lab 7: Use for loop Write a python program that computes sum of odd numbers in the list given below list1- [4, 3, 6, 5, 1,99, 22, 66, 15 10 Marks RESTART: Ci/Users/sanjay/6010691/W2018sanjay/code/sun of odd number in 11st.Py 11st1_ [4, 3, 6, 5, 1, 99, 22, 66, 15 15 The final sum 1s: 123 One of the ways can be define and print listi initialize sum to O iterate over listl with for loop for items in list # check if even continue # continue to next iteration else: #c. print items not even #sum the items #d, print final sum

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

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

What are some of the important outcomes of job satisfaction?

Answered: 1 week ago