>>> for i in range(4, 24, 2): print i 4 6 8 10 12 14 16 18 20 22
>>> start = 4 >>> numRecords = 10 >>> step = 2 >>> >>> upperbound = numRecords*step + start >>> print upperbound 24 >>> for i in range(start, upperbound, step): print i 4 6 8 10 12 14 16 18 20 22 >>> >>> # demonstrate changing the input params: >>> start = 200 >>> step = 40 >>> numRecords = 7 >>> # same code, different input values, based on new input params >>> upperbound = numRecords*step + start >>> for i in range(start, upperbound, step): print i 200 240 280 320 360 400 440 >>>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.