Skip to content

Akshay-ASRK/python-programming-questions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-programming-questions


title: filter_even_numbers

Problem Statement

Question 3: Data Processing I/O

Write a function filter_even_numbers that: Takes a list of integers as input from stdin. Prints the sorted list of even integers to stdout.

Solution

<prefix>

</prefix>
<template>
<sol> 
def filter_even_numbers():
    import sys
    nums = list(map(int, sys.stdin.readline().strip().split()))
    evens = sorted([num for num in nums if num % 2 == 0])
    print(" ".join(map(str, evens)))
</sol>
</template>
<suffix>

</suffix>
<suffix_invisible>

</suffix_invisible>

Public Test Cases

Input 1

10 15 8 7 12

Output 1

(filter_even_numbers() == 8 10 12)

Private Test Cases

Input 1

3 5 2 8 1 0

Output 1

(filter_even_numbers() == 0 2 8)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published