Bissoy.com
Login
Doctors Medicines MCQs Q&A
Ask Merit Test Questions Courses

Write a program to calculate and display the sum of all the odd numbers in the list.

Write a program to calculate and display the sum of all the odd numbers in the list.

Monjur Alahi
Monjur Alahi
9 views
2025-01-04 04:42

1 Answers

Salim Ahmed Kawsar
Salim Ahmed Kawsar

pos = 0 

sum = 0 

while pos < len (L): 

if L[pos] %2 = = 1 : 

sum = sum + L [pos] 

pos = pos + 1 

print sum 

9 views Answered 2023-02-05 15:29

Related Questions

There are three odd numbers and one even number. What type of number is their sum ? 
2 Answers 5 Views
There are three odd numbers and one even number. What type of number is their sum ? 
2 Answers 4 Views
The statement “the sum of two odd numbers is odd” is 
2 Answers 7 Views
The sum of three numbers is 2. If twice the second number is added to the sum of first and third, we get 1. On adding the sum of second and third numb
2 Answers 5 Views
The sum of two numbers is 8 and 15 times the sum of their reciprocals is also 8. Find the numbers.
2 Answers 5 Views
The sum of two numbers is 9. The sum of their reciprocals is 1/2. Find the numbers.
2 Answers 4 Views
Ravi wants to display the name of 6 subjects as a list by using Upper case Roman Numerals.
2 Answers 6 Views
Predict the output. 1. int sum = 10, ctr = 5; sum = sum + ctr–;
2 Answers 5 Views
Find the sum of all odd numbers between 0 and 50.
2 Answers 5 Views
Write a program to pass any list and to arrange all numbers in descending order.
2 Answers 4 Views
  • কোরআন
  • হাদিস
  • চাকুরি প্রস্তুতি
  • বিশ্ববিদ্যালয় ভর্তি
  • মেডিকেল SBA
  • 12 এইচএসসি
  • 10 এসএসসি
  • 8 জেএসসি
এক্সাম দিয়ে মেধা যাচাই করুন
Job Preparation (1125)
Admission (754)
এসএসসি (10)
এইচএসসি (5)
Login Required

You need to log in to continue.

Login
Download Required

You need to download the app to make a call.

Download
ভিডিও কলে কথা বলতে প্লে স্টোর থেকে Bissoy অ্যাপ ডাউনলোড করুন অথবা প্রশ্ন উত্তর করতে লগইন করুন
📱 ডাউনলোড
  • অ্যাফিলিয়েট
  • FAQ
  • About Us
  • Privacy Policy
  • T&C
  • DMCA

© Bissoy, 2014 - 2025