Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'append': 0.09; 'check,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrote': 0.14; 'programmer,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'code.': 0.18; 'header:X-Complaints-To:1': 0.27; 'sets': 0.30; "skip:' 10": 0.31; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'course': 0.61; "you're": 0.61; 'email addr:gmail.com': 0.63; 'received:myvzw.com': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Flag control variable Date: Wed, 12 Feb 2014 00:23:14 -0500 (EST) Organization: news.gmane.org References: <68f27949-e613-476b-9227-5a86e4f4df91@googlegroups.com> X-Gmane-NNTP-Posting-Host: 105.sub-70-208-135.myvzw.com X-Newsreader: PiaoHong Usenet NewsReaders 1.36 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392182391 news.xs4all.nl 2944 [2001:888:2000:d::a6]:34659 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65998 luke.geelen@gmail.com Wrote in message: > Can I make it that if > C = int(sys.argv[3]) > But when I only enter 2 argumentvariable it sets c automaticly to 0 or 1 > Why do you ask for 'automatically'? You're the programmer, write the test in the code. if len (sys.argv) == 3: sys.argv. append ("0") But of course there are lots of other things you need to check, so consider all of them at the same time. -- DaveA