Compare Two Numbers
Python
Easy
3 views
Problem Description
Read two integers a and b. Output < if a if a>b else =.
Input Format
One line: a b.
Output Format
One symbol: < or > or =.
Official Solution
import sys
p=sys.stdin.read().strip().split()
if len(p)<2: sys.exit(0)
a=int(p[0]); b=int(p[1])
if a<b: sys.stdout.write('<')
elif a>b: sys.stdout.write('>')
else: sys.stdout.write('=')
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!