[Tutor] small program
transmogribenno at gmail.com
Fri Oct 2 10:29:14 CEST 2009
On Thu, Oct 1, 2009 at 8:31 PM, Andrius <ziniatinklis at gmail.com> wrote:
> There are interesting online course
> where I'm trying to learn Python.
> Looks quite interesting and I would like to create a program which
> should repeat a simply string several times with list number before.
> Like "1. Wanna more. 2. Wanna more. ..."
> Suppose to a loop here repeating, say x times. Should it look like that:
> y="Wanna more. "
> print d+y
> How to create a program for such kind of task?
[Forgot to reply-all the first time:]
Something like this should do the trick, if I get what you're trying to do:
x = 10
for i in range (1, x + 1):
print i, "whee"
More information about the Tutor