Flag control variable

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Wed Feb 12 17:10:36 CET 2014


luke.geelen at gmail.com writes:

> 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

C = int(sys.argv[3]) if len(sys.argv) > 3 else 0

is one possibility.

-- Alain.




More information about the Python-list mailing list