Let's denote the number of games Ahmadullah's basketball team played last season as \( x \).
According to the information given, the number of games they are playing this season (21 games) is 12 games more than one-third of the number of games they played last season. We can set up the equation based on this information:
\[ 21 = \frac{1}{3}x + 12 \]
To solve for \( x \), we first isolate \(\frac{1}{3}x\):
\[ 21 - 12 = \frac{1}{3}x \]
This simplifies to:
\[ 9 = \frac{1}{3}x \]
Next, we multiply both sides of the equation by 3 to eliminate the fraction:
\[ 9 \times 3 = x \]
This results in:
\[ x = 27 \]
Thus, the number of games Ahmadullah's basketball team played last season is \( \boxed{27} \).
To verify, we can check if 21 is indeed 12 more than one-third of 27:
Calculating one-third of 27:
\[ \frac{1}{3} \times 27 = 9 \]
Now adding 12 to this result:
\[ 9 + 12 = 21 \]
Since this checks out, the solution is confirmed. The team played 27 games last season.