[Tutor] Newbie

Wim De Hul wim at dehul.com
Wed Jul 23 19:58:34 CEST 2008


Hey Sam,

The way your output is formatted is because you use a comma after  
print i and you use an indent too much. The indent is used to group  
everything that has to be in the for loop (for your example).

Your program should run fine if you do it like this

> print "Hello World!"
> print "Here are the ten numbers from 0 to 9"
> for i in range(10) :
>     print i
> print "Goodbye World!"



Cheers & happy programming!

Wim

On 23 Jul 2008, at 19:29, Sam Last Name wrote:

> Hey guys, I'm wanting to learn Python and eventually how to program  
> with it. I'm 16 and very eager to learn. I already have a question.
>
> Heres my script:
> print "Hello World!"
> print "Here are the ten numbers from 0 to 9"
> for i in range(10) :
>     print i,
>     print "Goodbye World!"
>
> Result of my script :
> Hello World!
> Here are the ten numbers from 0 to 9
> 0 Goodbye World!
> 1 Goodbye World!
> 2 Goodbye World!
> 3 Goodbye World!
> 4 Goodbye World!
> 5 Goodbye World!
> 6 Goodbye World!
> 7 Goodbye World!
> 8 Goodbye World!
> 9 Goodbye World!
>
>
> I don't Understand. I have an idea it something like Goodbye world  
> is threading together with the numbers? Feedback is Thanked :)
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080723/937de087/attachment.htm>


More information about the Tutor mailing list