Since otherwise is not stated, I will assume that all 10 digits from 0 to 9 are allowed for all positions and repeating of digits is allowed. Then the total number of all possible codes is equal to(each of ten digits is allowed in each of 4 positions). The number of codes that do not the digit of 7 in any of 4 positions is (9 digits in each of 4 positions). Therefore the probability under the question is = = 0.6561 = 65.61%.