Answer to Question #306573 in Python for Aswad

Question #306573

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-06T14:04:53-0500
n=0
while(n!=2):
    input1 = (str(input("Enter two numbers separated by space: "))).split(" ")
    n = len(input1)



s_1=0
for s in range(0,len(input1[0])): 
    t1 = int(input1[0][s])
    t2 = int(input1[1][s])
    if((t1+t2)>9):
        s_1=1
if(s_1): 
    print("HARD")
else: 
    print("EASY")

Enter two numbers separated by space: 240 300
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