Course Hero Logo

Section 4.6 - IT 140: Introduction to Scripting.pdf -...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 5 pages.

!Students:Section 4.6 is a part of 1 assignment:4-1 zyBooks Participation ActivitiesRequirements:PADue: 08/29/2033, 8:59 AMJST4.6 Counting using the range() functionThe range() functionWhile loops are commonly used for counting a speciKc number of iterations, and for loopsare commonly used to iterate over all elements of a container. The range() function allowscounting in for loops as well.range()generates a sequence of numbers, starting at zero andending before a value given inside the parentheses. Ex:for i in range(3)sets i to 0during the Krst iteration of the for loop, i to 1 during the second iteration, and Knally i to 2 onthe third iteration. The value within the parentheses is not included in the generatedsequence.The range() function can take up to three arguments to indicate the starting value of thesequence, the ending value of the sequence minus 1, and the interval between numbers.Table 4.6.1: Using the range() function.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 5 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
N/A
Tags
savings

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture