Answer to Question #305131 in Python for Murali

Question #305131

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

229 390

Sample Output1

Hard


Sample Input2

123456789 9876543218

Sample Output2

Easy


1
Expert's answer
2022-03-02T15:33:57-0500
l = 0
while (l != 2):
    s = (str(input("Enter two numbers separated by space: "))).split(" ")
    l = len(s)

Flag = 0
for r in range(0, len(s[0])):

    t1 = int(s[0][r])
    t2 = int(s[1][r])
    if ((t1 + t2) > 9): Flag = 1
if (Flag):
    print("HARD")
else:
    print("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