3 Replies - 415 Views - Last Post: 10 March 2016 - 09:44 AM Rate Topic: -----

#1 scotty247  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-March 16

for loops

Posted 10 March 2016 - 05:37 AM

I'm having trouble understanding how to create a for loop and how to use it to implement different tasks. For this specific assignment we have to create a program using a for loop. I don't know how I can use this type of loop to do so. Would someone be able help me understand the functions of for loops and how to manipulate them?

I know this is a really simple question, sorry I'm learning for the first time.
Is This A Good Question/Topic? 0
  • +

Replies To: for loops

#2 ndc85430  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,583
  • Joined: 13-June 14

Re: for loops

Posted 10 March 2016 - 05:42 AM

Firstly, it would help if you told us what your understanding of a for loop is.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is offline

  • say what now
  • member icon

Reputation: 6409
  • View blog
  • Posts: 25,892
  • Joined: 12-December 12

Re: for loops

Posted 10 March 2016 - 05:44 AM

Where reference material and examples have you studied?
Was This Post Helpful? 0
  • +
  • -

#4 Marbelous  Icon User is offline

  • D.I.C Head

Reputation: 43
  • View blog
  • Posts: 136
  • Joined: 12-November 12

Re: for loops

Posted 10 March 2016 - 09:44 AM

The official python tutorial that ships with python covers loops very early on. Here is a link to the on-line version. Read through up to chapter 4. https://docs.python.org/3/tutorial/

Super simple python for-loop examples:
for letter in "Hello World":
    print letter  # Prints all the letters in the given string object one at a time.

for num in range(10):
    print num  # Prints the numbers 0 through 9 one at a time.

This post has been edited by Marbelous: 10 March 2016 - 09:45 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1