I want to check the first two digits of a number in Python. Something like this:
for i in range(1000):
if(first two digits of i == 15):
print("15")
elif(first two digits of i == 16):
print("16")
Is there a command to check the first two digits of a number? I'd like to avoid commands like if(i>149 and i<160):...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…