Answers for "Loops"

0

cmd for loop

REM # | EXAMPLE: For loop to copy all the files in the current directory to the C:\User\ folder
For %F in (*) do copy %F C:\User\

REM # | SYNTAX
REM # | For %F in (<Files to loop through with space delimiters>) do <Command to do with %F>


REM # | NOTE: you can use the following to extract specific parts of a filepath
REM # | take note that this syntax only works when run from a batch file
@echo off
setlocal
set file=C:\Users\l72rugschiri\Desktop\fs.cfg
for %%N IN ("%file%") do (
   	echo filedrive=%%~dN
	echo filepath=%%~pN
	echo filename=%%~nN
	echo fileextension=%%~xN
    echo default=%%N
)
Posted by: Guest on June-10-2020
0

loops in coding

Do
 Do_Something
Loop
Posted by: Guest on May-08-2020
0

loops in coding

Do
 X = 5+2
Loop Until X > 5
Posted by: Guest on May-08-2020
2

loops

for {} in {}:
	#do-something
Posted by: Guest on May-18-2021
-1

Loops

my_number = 42
your_guess = 0
while (your_guess != my_number):
    your_input = input("Guess my number: ")
    your_guess = int(your_input)
    if your_guess < my_number:
        print("guess higher!")
    elif your_guess > my_number:
        print("guess lower!")
print("You got it!")pythonCopied!
Posted by: Guest on September-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language