User Tools

Site Tools


prog

Аргументы командной строки

python

import sys
 
print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)

Цикл for в интервале

python

# For loop from 0 to 2, therefore running 3 times.
for x in range(0, 3):
    print "We're on time %d" % (x)

Длина массива

python

# list of integers
my_list = [1, 2, 3]
 
# length
k = len(my_list)
prog.txt · Last modified: 2019/03/13 08:00 by sergeyvl