Discussions Events Study Material Jobs
Print All Even Numbers in a List using while loop in Python - Uniwaly

Explore Diverse Conversations

Print All Even Numbers in a List using while loop in Python

Posted By: UmairMehmood Published On: 13 June 2025 At: 11:43 AM

Input a list of 10 numbers and print only the even ones using a while loop.
numbers = []

i = 0
while i < 10:
    num = int(input(f"Enter number {i+1}: "))
    numbers.append(num)
    i += 1
print("\nEven numbers in the list:")
j = 0
while j < len(numbers):
    if numbers[j] % 2 == 0:
        print(numbers[j])
    j += 1


Tags:

python python list python while loop
Login to like

Posted By:

Author Profile

UmairMehmood

11 days ago

Join the conversation!

Login to Comment

Discover More Articles

Elucidate the role of public and private sector in elementary education. Discuss the role of government of Pakistan in this context.

Critically discuss Quality and Access as to two problems in higher education. Suggest some ways to address these problems.

Login System Hardcoded Using Python

Discuss need of assessment in higher education in Pakistan? Up to what extent you are satisfied with the present assessment system and how it can be improved?

حکومت کی مارچ 2025 تک بجلی 12 روپے سستی کرنے کی تیاری جیو

Explain the concept of economics of higher education in Pakistan. What are different ways of financing higher education in Pakistan?

Merge Two Dictionaries using Python

Habib University Admission Process

Government University and Collage Faisalabad ( GCUF ) Admission Criteria All Departments

Rescue 1122 Punjab Jobs 2025 For Multiple Categories