Answer to Question #306562 in Python for babu

Question #306562

question: Difficult Addition


Arjun is trying to add two numbers. since he has learned addition recently, an addition which requires carry is difficult for him . your task is to print "Easy" if the addition doesn't

involve carry, otherwise print "Hard"


Input 1 :- 229 390

output 1 :- Hard

Input 2 :- 123456789 9876543210

output 2 :- Easy




1
Expert's answer
2022-03-07T12:54:35-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