Raw Input Question

hokiegal99 hokiegal99 at hotmail.com
Wed Aug 27 04:58:44 CEST 2003


This one makes more sense to me so I used it, it works great:

"Enter the string to replace %s with:" % XXX

Thank you for your help!!!


Erik Max Francis wrote:
> hokiegal99 wrote:
> 
> 
>>How can I pass the content of one varible into raw_input? See below
>>for
>>what I'm trying to do:
>>
>>XXX = raw_input("1. Enter the string that you'd like to find: ")
>>y = raw_input("2. Enter the string that you'd like to replace XXX
>>with: ")
>>
>>I'm trying to pass x into y. I tried the "Enter the string that you'd
>>like to replace", XXX, "with:" approach, but Pyhton told me that I
>>could
>>only pass 1 argument, no more.
> 
> 
> raw_input takes a string, and a string like any other.  You can build
> the string yourself:
> 
> 	"Enter the string to replace " + XXX + " with:"
> 
> or
> 
> 	"Enter the string to replace %s with:" % XXX
> 






More information about the Python-list mailing list