Practice Mode 1: Interact with me step by step(练习方式一:一步一步与我互动)
Try: Explain how to create a for loop in a batch script.
Discover: In a batch script, you can create a for loop using the formula for /L %%variable in (start,step,end) do command
. For example, for /L %%i in (1,1,10) do echo %%i
will print numbers from 1 to 10.
Practice: Please repeat the formula for creating a for loop.
Practice: To print numbers from 5 to 15 using a for loop in a batch script, you can use the following formula:
for /L %%i in (5,1,15) do echo %%i