Closed Thread
Results 1 to 3 of 3

Thread: problem

  1. #1
    h4x Guest

    problem

    some time ago i had a problem to solve wich i needed a python script.
    but i couldnt compile it -,-
    Code:
    i = 0
    for i in range(0,10):
    print 'Hello World!'
    also i-- generate another error, WTF?!

  2. CODECALL Circuit advertisement

     
  3. #2
    Join Date
    Jul 2009
    Location
    Santa Clarita, CA
    Posts
    2,111
    Blog Entries
    47
    Rep Power
    31

    Re: problem

    Compile? You mean run, Python scripts aren't compiled normally, they're just interpreted.

    You don't need to declare that i = 0 at the beginning, it'll do that automatically when you say "for i in range(0, 10)". You can still do that, nothing wrong with it, it just won't do you any good since the "in range" part will make i = 0 at the beginning anyway. The second problem is the clencher, Python works using whitespace, which you didn't provide any for the for loop. Do it this way instead:
    [highlight=Python]for i in range(0, 10):
    print 'Hello World!'[/highlight]
    That'll work properly.

    EDIT: Also, i-- doesn't work, use --i instead.
    Wow I changed my sig!

  4. #3
    h4x Guest

    Re: problem

    thx for answer, now works fine. i was wondering why when i ctrl+v code it doesnt work, now i know.
    Code:
    Compile? You mean run, Python scripts aren't compiled normally, they're just interpreted.
    whatever~

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. If problem or cout problem?
    By chaoticape in forum C and C++
    Replies: 4
    Last Post: 06-10-2011, 10:29 AM
  2. C: Problem with solving problem
    By rakche in forum C and C++
    Replies: 15
    Last Post: 03-28-2010, 01:24 PM
  3. Replies: 0
    Last Post: 04-26-2007, 05:33 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts