[Tutor] small program
wescpy at gmail.com
Fri Oct 2 10:33:53 CEST 2009
> 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?
hi Andrius, welcome to Python! interesting course you're taking.
before proceeding with this homework exercise, i would first rewatch
lecture 2, as this is where loops are covered... you will need one of
Python's two looping mechanisms to complete this exercise with.
your pseudocode is a good start, but you need to turn it into Python.
i would suggest also having some sort of reference where you can
lookup basic constructs where you need it.
finally, when you get started, if you are running into errors you
cannot explain nor look up online, then cut-n-paste your entire
program as well as the erroneous output in full here, and we can help
best of luck!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
More information about the Tutor