#There is a treasure chest with 1 million dollars. The chest has a 5-digit #combination lock that opens under the following conditions: the first digit #should be equal to the fifth digit, the second digit should be odd, and the #product of the third and forth digits should be divisible by 7. Write a #program that reads one 5-digit positive integer and checks whether the input #number opens the chest or not. The output should be YES, if the chest opens, #and NO otherwise. #Discussion: #Input: one integer, 10000 and 99999, stored in combo #Calculations, first separate digits, using %10, //10 #use if-else combo=int(input("enter combination ")) if(combo>=10000 and combo<=99999): save_num=combo d5=combo%10 combo=combo//10 d4=combo%10 combo=combo//10 d3=combo%10 combo=combo//10 d2=combo%10 combo=combo//10 d1=combo%10 if(d1==d5 and d2%2!=0 and (d3*d4)%7==0): print("YES", save_num, "opens the chest") else: print("NO", save_num, "DOESN'T open the chest") else: print("invalid input") #Test 1: 77777 YES #Test 2: 13271 YES #Test 3: 11111 NO #Test 4: 22222 NO #Test 5: 12345 NO #Test 6: 12271 NO