pandas drop column by index range

# drop columns 0 to 3
droprange = list(range(0, 4))
df.drop(df.columns[droprange], axis=1, inplace=True)

Here is what the above code is Doing:
1. We’re creating a list of integers from 0 to 3.
2. We’re using the drop() method to drop the columns at the indices in the list.
3. We’re setting the axis parameter to 1 to indicate that we want to drop columns and not rows.
4. We’re setting the inplace parameter to True to make the changes in the same DataFrame.