Answer to Question #307315 in Python for Kiran

Question #307315

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-07T12:53:12-0500
def is_hard():
    i = 0
    while(i!=2):
        input1 = (str(input("Enter two numbers separated by space: "))).split(" ")
        i = 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")


is_hard()

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