Learning question...

swapsun at gmail.com swapsun at gmail.com
Wed May 7 08:25:25 EDT 2008


Any idea why the following program does not work? I was learning IO on
Python and the following generates a TypeError: range() integer end
argument expected, got str.
I am a beginner.

################################
# print input name (str k), j times using raw_input

def hello():
    j=raw_input("Please type in the number of times you want to print
")
    k=raw_input("Please type in your name ")
    printname(j,k)

def printname(j,k):
          for i in range(j):
                print ("Hello %s" % k)
################################



More information about the Python-list mailing list