Answer to Question #305671 in Python for Rakesh

Question #305671

Difficult Addition


Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.


Input

The first line of input contains two space separated integers A and B.


Output

If the addition does not involve a carry,print Easy, otherwise print Hard.


Explanation

When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.



Sample Input1

123456789 9876543218

Sample Output1

Easy


Sample Input2

229 390

Sample Output2

Hard


1
Expert's answer
2022-03-03T17:08:47-0500
s = input('>')
s = s.split(' ')
n1 = s[0]
n2 = s[1]
carry = False
if len(n1) > len(n2):
    n1, n2 = n2, n1
for i in range(len(n1)):
    if int(n1[i])+int(n2[i]) > 10:
        carry = True
if carry:
    print('Hard')
else:
    print('Easy')

>229 390

Hard

>123456789 9876543218

Easy


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS