SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: subtracting from strings
Threaded View
-
Oct 4, 2009, 18:59 #1
- Join Date
- Apr 2009
- Posts
- 18
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
subtracting from strings
So I have a string called "mainString1" and it has a list consisting of "pearls diamonds jewels rocks" I have another that contains the input from the user called "enteredList" and I want to subtract anything from "mainString1" that is entered by the user so if they entered "pearls" then it prints "diamonds jewels rocks"
I'm not sure of all that is wrong with the following
Code:if enteredList.find(mainString1) != 1: print "You still need the following:" print mainString1 - enteredList
Bookmarks