Pentan-2-one (a methyl ketone) reacts with halogens in presence of alkali to form haloform. This reaction is called the haloform reaction.
Pentan-3-one does not give haloform reaction. Hence, this reaction can be used to distinguish pentan-2-one and pentan-3-one.