Even Odd Using Mod
Python
Easy
3 views
Problem Description
Read one integer n. Output EVEN if n is even else ODD.
Input Format
One integer n.
Output Format
EVEN or ODD.
Official Solution
import sys
s=sys.stdin.read().strip()
if not s: sys.exit(0)
n=int(s)
sys.stdout.write('EVEN' if n%2==0 else 'ODD')
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!