mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-13 20:56:54 +01:00
03/00
This commit is contained in:
14
03/ex0/ft_command_quest.py
Normal file
14
03/ex0/ft_command_quest.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
args = sys.argv
|
||||||
|
if len(args) <= 1:
|
||||||
|
print("No arguments provided !")
|
||||||
|
print("Program name: " + args[0])
|
||||||
|
if len(args) > 1:
|
||||||
|
print("Arguments received:", len(args) - 1)
|
||||||
|
i = 1
|
||||||
|
while i < len(args):
|
||||||
|
print("Argument", i, ":", args[i])
|
||||||
|
i = i + 1
|
||||||
|
print("Total arguments:", len(args))
|
||||||
Reference in New Issue
Block a user