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

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

Create a dictionary with keys as subjects and values as marks. Print marks for a given subject using Python

UNIVERSITY OF MANAGEMENT AND TECHNOLOGY ( UMT ) - Admission Process

Field Manager - The Urban Unit Jobs 2025

Content Writing Prompt Using ChatGPT and DeepSeek

Understanding Anonymous Proxy Detection: Challenges, Implications, and Solutions

Explain how action research by the teachers in class helps in effective teaching and improved learning outcomes

Bank Alfalah Management Trainee Program and Summer Internship Program 2025

Pension New Method Explained - Which Employees Not Eligible For Pension ?

University of Veterinary & Animal Sciences UVAS Swat