Hey Guys :
Here The problem is :to have a program to check the
-(sys.argv) is long enough to have more than 3 elements if not then print "input more "
-check (sys.argv) contain a specific elements for ex(P) ,& if P is found in the given elements then it should also check for P+3(that mean the 4th elements after p) if also P then print "fount at )then the position at which the 1st P is found !!
the program can be run from the :Administrator: command Prompt ..
well I need a little guidence to solve this : here what i have done so far though I wont think this is enough at all !!
import sys for i in (sys.argv): if "p p" in (sys.argv): print yes
the below example ,I managed to solved it myself & (Not related to the above problem )to be run from command Prompt /Administrator :
the problem was to type what ever you type after executing the program in the command prompt & using (import sys & also sys.argv) :
for example try to point where is your file is :
c:\users\robert\desktop\name of your file.type anything
after executing the above it will appear like this :
& then it enumerate the name & length of each ...
import sys print "No.of arguments is ",len(sys.argv) print" " print "Now I will Print the Arguments & Length of each";print " " for i in (sys.argv): print i,", length ",len(i)